
jQuery(document).ready(function() {	

	/*
	jQuery(".flash_video_fancy").fancybox(
		{
			onStart : function () {
				jQuery(".flash_video_fancy").show();
			},
			onClosed : function () {
			jQuery(".flash_video_fancy").remove();
		}}
	).trigger('click');
	*/
	
jQuery("#menu_home").hover(
	function () // mouse in
	{
		jQuery(this).find("#menu_home2").removeClass("menu_first");
		jQuery(this).find("#menu_home2").addClass("menu_first_hover");
	},
	function () // mouse out
	{
		
		jQuery(this).find("#menu_home2").removeClass("menu_first_hover");
		jQuery(this).find("#menu_home2").addClass("menu_first");	 
	});

jQuery('#TestDriveDialog').dialog({
								bgiframe: true,
								autoOpen: false,
								modal: true,
								width: 560,
								height: 550,
								resizable: false,
								buttons: {
											Ok: function() {
												jQuery(this).dialog('close');
											}
										}
									});	

jQuery("a#single_image").fancybox();

jQuery("a[rel=example_group]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titleShow'			: true
			});
jQuery("a[rel=example_group2]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titleShow'			: true
			});
jQuery("a#inline").fancybox({
	'hideOnContentClick': true
});

jQuery("a.iframe").fancybox({
	'width' : 1010,
	'height' : '90%'
});

jQuery("a.iframe_config").click(
	function ()
	{
		var hr = jQuery(this).attr("href");
		// alert(hr);
		jQuery.fancybox(
			{
			autoDimensions : false,
			width : 980,
			height : '89%',
			content : "<iframe border='0' frameborder='0' style='overflow-x: hidden;' padding='0' "+
			" width='100%' height='1600' src='" + hr + "'></iframe>"
			});
		return false;
	}
);

jQuery("a.iframe2").fancybox({
	'hideOnContentClick': false,
	'width' : '90%',
	'height' : '80%'
});

/*
jQuery("a.fancypdf").fancybox({
	 'frameWidth': '900px',
	 'frameHeight': '800px',
	 'centerOnScroll': true,
	 'type': 'iframe',
	 'hideOnContentClick': false
});
*/ 

jQuery("a.fancypdf").click(
	function ()
	{
		var hr = jQuery(this).attr("href");
		// ,top=' + topPos + ',left=' + leftPos
		var h = (jQuery(window).height() - 40);
		
		var leftPos = (screen.width - 990) / 2;
		var topPos = (screen.height - h) / 2;
		
		// alert(leftPos + "x" + topPos);
		
		window.open(hr, '', 'width=990,height=' + h + 
			',scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
		return false;
	});

jQuery("a.group").fancybox({
		
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'overlayShow':	true,
		'overlayOpacity': 0.7
	});

jQuery("#TestDriveDialog").dialog({
			bgiframe: true,
			autoOpen: false,
			modal: true,
			width: 480,
			//height: 120,
			resizable: false,
			buttons: {
						Cancel: function() {
							jQuery(this).dialog("close");
						}
					}
				});

jQuery('.slideshow_model').cycle({
						fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
			 });

jQuery('.slideshow_service').cycle({
		fx: 'turnDown' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});


jQuery("#validationErrorDialog").dialog({
			bgiframe: true,
			autoOpen: false,
			modal: true,
			width: 480,
			height: 220,
			resizable: false,
			buttons: {
						Cancel: function() {
							jQuery(this).dialog("close");
							jQuery(this).dialog({title : "Eroare"});
							// titile 
						}
					}
				});	
jQuery("#validationErrorsDialog").dialog({
			bgiframe: true,
			autoOpen: false,
			modal: true,
			width: 480,
			height: 120,
			resizable: false,
			buttons: {
						Cancel: function() {
							jQuery(this).dialog("close");
							jQuery(this).dialog({title : "Eroare"});
							// titile 
						}
					}
				});
jQuery('#screen').serialScroll({
 target:'#sections',
 items:'li', // Selector to the items ( relative to the matched elements, '#sections' in this case )
 prev:'img.prev',// Selector to the 'prev' button (absolute!, meaning it's relative to the document)
 next:'img.next',// Selector to the 'next' button (absolute too)
 axis:'xy',// The default is 'y' scroll on both ways
 navigation:'#navigation li a',
 duration:700,// Length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
 force:true, // Force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)
queue:false,// We scroll on both axes, scroll both at the same time.
event:'click',// On which event to react (click is the default, you probably won't need to specify it)
stop:false,// Each click will stop any previous animations of the target. (false by default)
lock:true, // Ignore events if already animating (true by default)
start: 0, // On which element (index) to begin ( 0 is the default, redundant in this case )
cycle:true,// Cycle endlessly ( constant velocity, true is the default )
step:1, // How many items to scroll each time ( 1 is the default, no need to specify )
jump:false, // If true, items become clickable (or w/e 'event' is, and when activated, the pane scrolls to them)
lazy:false,// (default) if true, the plugin looks for the items on each event(allows AJAX or JS content, or reordering)
interval:1000, // It's the number of milliseconds to automatically go to the next
constant:true, // constant speed

 onBefore:function( e, elem, $pane, $items, pos ){ 
	e.preventDefault();
 if( this.blur )
 this.blur();
 },
 onAfter:function( elem ){
 //'this' is the element being scrolled ($pane) not jqueryfied
 }
 }); 
jQuery('#slideshow').serialScroll({
 items:'li',
 prev:'#screen2 a.prev',
 next:'#screen2 a.next',
 offset: 0, //when scrolling to photo, stop 230 before reaching it (from the left)
 start: 0, //as we are centering it, start at the 2nd
 duration: 1000,
 force: true,
 stop: false,
 interval: 0,
 step: 1,
 axis: 'x',
 event: 'click',
 lock: false,
 constant: true,
 cycle: false, //don't pull back once you reach the end
 easing: 'easeOutQuart', //use this easing equation for a funny effect
 jump: true //click on the images to scroll to them
 }); 


jQuery("#fancybox-wrap").css("z-index", "999999");
jQuery("#pikame").PikaChoose({auto_play: true});

jQuery(".pika_subdiv a").attr("href", "javascript: //");
jQuery(".pika_subdiv a").click(
		function ()
		{
			// nothing
			return false;
		});

});

