/* #################################################################
SCRIPT NAME: core.js
WRITTEN BY: andrew @ ica
FRAMEWORK: jQuery 1.3.2
If you wish to use any of this script then feel free to do so
- include this header blurb if you want or not; its up to you.
I Usually delete it so its only fair if you want to!
################################################################# */

$(document).ready(function(){

$("#txtconfirm").click(function(e){
e.preventDefault();
$("#sms").submit();
});



$("#quickbuy_EVENTS_button, #quickbuy_FILMS_button").click(function(e){
thisid = $(this).attr("id");
e.preventDefault();
newid = thisid.replace(/_button/g,'');
window.open($("#"+newid).val(),'_tickets');
});


/* ************ START OF MENU DROPDOWN************ */
     $('#nav-wrapper>li>a').click(function(e) {  
         e.preventDefault();var data="";
		name = $(this).parent().attr('id'); 
//$(this).parent().attr("class",name+"-active");

if($(this).attr("rel")!='home'){

$("#nav-wrapper>li>a").each(function(i){
thisname = $(this).parent().attr('id');

if(thisname != name){
$("#"+$(this).parent().attr('id')+"-links").hide();
$(this).attr("rel","away");
$(this).parent().attr("class",thisname);
}else{
$("#"+name+"-links").slideDown();
$(this).attr("rel","home");
}

});
/*   IF ALREADY SELECTED THEN HIDE     */
}else{
$("#"+$(this).parent().attr('id')+"-links").slideUp();
$("#"+$(this).parent().attr('id')+"").attr("class",$(this).parent().attr('id'));
$(this).attr("rel","away");
};				
});

});
/* ************ END OF MENU DROPDOWN************ */


function getdata(funcname, input, outputarea){
$.ajax({
    url: '/public/ajax/call.php?funcname='+funcname+'&input='+input+'&outputarea='+outputarea,
    type: 'GET',
    dataType: 'html',
    timeout: 1000,
    error: function(){
    },
    success: function(html){
	$("#"+outputarea).html(html);
    }
}); 
}



$(document).ready(function() {

$("#imdblink").mousedown(function(){
$("#imdbframe").attr("src",imdburl);
});


  $.nyroModalSettings({
    processHandler: function(settings) {
      var from = settings.from;
      if (from && from.href && from.href.indexOf('http://www.youtube.com/watch?v=') == 0) {
        $.nyroModalSettings({
          type: 'swf',
          height: 600,
          width: 940,
          url: from.href.replace(new RegExp("watch\\?v=", "i"), 'v/')
        });
      }

      
    }
  });
});

