// JavaScript Document
function Order_Validation(){
	if(document.getElementById('email').value == ''){
		alert('Please enter your email address.');
		document.getElementById('email').focus();
	}else if(echeck(document.getElementById('email').value) == false){
document.getElementById('email').focus();
return false;
}else if(document.getElementById('fname').value == ''){
		alert('Please enter your full name.');
		document.getElementById('fname').focus();
	}else{
		return true;	
	}
	return false;
}

function echeck(str) {
 var at="@"
 var dot="."
 var lat=str.indexOf(at)
 var lstr=str.length
 var ldot=str.indexOf(dot)
 if (str.indexOf(at)==-1){
 alert("Invalid E-mail ID")
 return false
 }

 if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
 alert("Invalid E-mail ID")
 return false
 }

 if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
 alert("Invalid E-mail ID")
 return false
 }

 if (str.indexOf(at,(lat+1))!=-1){
 alert("Invalid E-mail ID")
 return false
 }

 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
 alert("Invalid E-mail ID")
 return false
 }

 if (str.indexOf(dot,(lat+2))==-1){
 alert("Invalid E-mail ID")
 return false
 }

 if (str.indexOf(" ")!=-1){
 alert("Invalid E-mail ID")
 return false
 }

 return true
} 
// JQUERY
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ TOP ORDER FORM FLOADING MENU++++++++++++++++++++++++++++++
jQuery(document).ready(function() {
	
	jQuery('#logo_leaf').rotateAnimation(0);
	jQuery('#xhtmlleaf').rotateAnimation(0);
	jQuery('#wordpressleaf').rotateAnimation(0);
	jQuery('#joomlaleaf').rotateAnimation(0);
	jQuery('#drupalleaf').rotateAnimation(0);
	jQuery('#magentoleaf').rotateAnimation(0);

		jQuery('.pakages_container_box a').mouseover(function() {
			jQuery('#logo_leaf').rotateAnimation(-85);
		});	
		jQuery('.pakages_container_box a').mouseout(function() {
			jQuery('#logo_leaf').rotateAnimation(0);
		});	

		jQuery('#logo a').mouseover(function() {
			jQuery('#logo_leaf').rotateAnimation(-85);
		});	
		jQuery('#logo a').mouseout(function() {
			jQuery('#logo_leaf').rotateAnimation(0);
		});	

		jQuery('.pakages_container_box a.xhtml').mouseover(function() {
			jQuery('#xhtmlleaf').rotateAnimation(-35);
		});	
		jQuery('.pakages_container_box a.xhtml').mouseout(function() {
			jQuery('#xhtmlleaf').rotateAnimation(0);
		});	
		
jQuery('#head_bottom_text a.ordernow').mouseover(function() {
			jQuery('#xhtmlleaf').rotateAnimation(-35);
			jQuery('#wordpressleaf').rotateAnimation(-35);
			jQuery('#joomlaleaf').rotateAnimation(-35);
			jQuery('#drupalleaf').rotateAnimation(-35);
			jQuery('#magentoleaf').rotateAnimation(-35);
			jQuery('#logo_leaf').rotateAnimation(-85);
			

		});	
jQuery('#head_bottom_text a.ordernow').mouseout(function() {
			jQuery('#xhtmlleaf').rotateAnimation(0);
			jQuery('#wordpressleaf').rotateAnimation(0);
			jQuery('#joomlaleaf').rotateAnimation(0);
			jQuery('#drupalleaf').rotateAnimation(0);
			jQuery('#magentoleaf').rotateAnimation(0);
			jQuery('#logo_leaf').rotateAnimation(0);
		});

		jQuery('.pakages_container_box a.wordpress').mouseover(function() {
			jQuery('#wordpressleaf').rotateAnimation(-35);
		});	
		jQuery('.pakages_container_box a.wordpress').mouseout(function() {
			jQuery('#wordpressleaf').rotateAnimation(0);
		});

		jQuery('.pakages_container_box a.joomla').mouseover(function() {
			jQuery('#joomlaleaf').rotateAnimation(-35);
		});	

		jQuery('.pakages_container_box a.joomla').mouseout(function() {
			jQuery('#joomlaleaf').rotateAnimation(0);
		});

		jQuery('.pakages_container_box a.drupal').mouseover(function() {
			jQuery('#drupalleaf').rotateAnimation(-35);
		});	

		jQuery('.pakages_container_box a.drupal').mouseout(function() {
			jQuery('#drupalleaf').rotateAnimation(0);
		});

		jQuery('.pakages_container_box a.magento').mouseover(function() {
			jQuery('#magentoleaf').rotateAnimation(-35);
		});	

		jQuery('.pakages_container_box a.magento').mouseout(function() {
			jQuery('#magentoleaf').rotateAnimation(0);
		});

								
	var top = '-' + jQuery('#slidedown_content .content').css('height');
	var easing = 'easeOutBounce';

	jQuery('#slidedown_top').mouseover(function() {
		jQuery('#slidedown_content').animate({'top' : 0}, {queue:false, duration:1000, easing: easing});
	});

	jQuery('#slidedown_bottom').mouseover(function() {
		jQuery('#slidedown_content').animate({'top' : top}, {queue:false, duration:500, easing: 'easeOutBounce'});
	});
	jQuery(".cart-button").hover(function(){
                jQuery(".cart-button img")
                .animate({top:"-50px"}, 300).animate({top:"-4px"}, 200) // first jump
                .animate({top:"-10px"}, 100).animate({top:"-4px"}, 100) // second jump
                .animate({top:"-9px"}, 100).animate({top:"-4px"}, 100); // the last jump
            });
	jQuery('#Items').selectbox();
	jQuery('#sidebar select').selectbox();
	jQuery('a.cart-button').click(function () {		
		//Get the data from all the fields
		var name = jQuery('input[name=fname]');
		var email = jQuery('input[name=email]');
		var website = jQuery('input[name=link]');
		var pages = jQuery('input[name=pages_number]');
		var turnaround = jQuery('input[name=turnaround_lable]');
		var implementation = jQuery('input[name=implementation_lable]');
		var comments = jQuery('textarea[name=pro_details]');
		var feedback = jQuery('textarea[name=field-feedback]');
		var session_id = jQuery('input[name=session_id]');
		var total_amount = jQuery('input[name=total_amount]');
		var upfront_amount = jQuery('input[name=upfront_amount]');
		//Simple validation to make sure user entered something
		//If error found, add hightlight class to the text field
		if (name.val()=='') {
			name.addClass('hightlight');
			return false;
		} else name.removeClass('hightlight');
		
		if (email.val()=='') {
			email.addClass('hightlight');
			return false;
		}else if (email.val().indexOf('@') == -1 || email.val().indexOf('.') == -1 || email.val().indexOf(' ') >= 0) {
			email.addClass('hightlight');
			return false;
		} else email.removeClass('hightlight');
		//organize the data properly
		var data = 'name='+name.val()+'&email='+email.val()+'&website='+encodeURIComponent(website.val().replace("http://",""))+'&comments='+encodeURIComponent(comments.val())+'&turnaround='+turnaround.val()+'&implementation='+encodeURIComponent(implementation.val())+'&feedback='+encodeURIComponent(feedback.val())+'&pages='+encodeURIComponent(pages.val())+'&session_id='+session_id.val()+'&upfront='+encodeURIComponent(upfront_amount.val())+'&total='+encodeURIComponent(total_amount.val());
		//disabled all the text fields
		jQuery('#form_left h4 input[type=text], #form_left3 fieldset textarea').attr('disabled','true');
//		jQuery('.selecter').attr('disabled','true');
		//show the loading sign
		jQuery('#mycart .loading').show();
		//start the ajax
		jQuery.ajax({
			//this is the php file that processes the data and send mail
			url: "http://www.slicingpsdtohtml.com/source/process.php",	
			
			//GET method is used
			type: "get",

			//pass the data			
			data: data,		
			
			//Do not cache the page
			cache: false,
			
			//success
			success: function (html) {				
				//if process.php returned 1/true (send mail success)
				if (html !='0') {					
					//hide the form
					jQuery('#form').animate({'top' : -2000}, {queue:false, duration:500, easing: 'easeOutBounce'})				
					//show the success message
					jQuery('.done').animate({'top' : 0}, {queue:false, duration:100, easing: 'easeOutBounce'})
					jQuery('.done').html(html);
				//if process.php returned 0/false (send mail failed)
				} else alert('Sorry, unexpected error. Please try again later.');				
			}		
		});
		
		//cancel the submit button default behaviours
		return false;
	});	
	jQuery('#call-me-button a').click(function () {		
		//Get the data from all the fields
		var intrested = jQuery('select[name=intrested]');
		var name = jQuery('input[name=txtfname]');
		var email = jQuery('input[name=txtemail]');
		var capcha = jQuery('input[name=txtverify]');
		var comments = jQuery('textarea[name=project_comments]');
		var Items_input = jQuery('input[id=Items_input]');
		var cc = jQuery('input[name=cc]');
		var ans1 = jQuery('#q_u_1_footer');
		var ans2 = jQuery('#q_u_2_footer');
		//Simple validation to make sure user entered something
		//If error found, add hightlight class to the text field
	if (intrested.val()=='') {
			Items_input.addClass('hightlight');
			return false;
		} else Items_input.removeClass('hightlight');
		if (name.val()=='') {
			name.addClass('hightlight');
			return false;
		} else name.removeClass('hightlight');
		
		if (email.val()=='') {
			email.addClass('hightlight');
			return false;
		}else if (email.val().indexOf('@') == -1 || email.val().indexOf('.') == -1 || email.val().indexOf(' ') >= 0) {
			email.addClass('hightlight');
			return false;
		} else email.removeClass('hightlight');
		if (comments.val()=='') {
			comments.addClass('hightlight');
			return false;
		}else comments.removeClass('hightlight');
		if (capcha.val() != (parseInt(ans1.html())+parseInt(ans2.html()))) {
			capcha.addClass('hightlight');
			return false;
		} else capcha.removeClass('hightlight');
		
		//organize the data properly
		var data = 'intrested=' + intrested.val() + '&name=' + name.val() + '&email=' + email.val() + '&comments='+ encodeURIComponent(comments.val())+'&cc='+ cc.val();
		
		//disabled all the text fields
		jQuery('#footer-form-main h4 input[type=text], #footer-form-main h4 textarea').attr('disabled','true');
//		jQuery('.selecter').attr('disabled','true');
		//show the loading sign
		jQuery('#call-me .loading').show();
		//start the ajax
		jQuery.ajax({
			//this is the php file that processes the data and send mail
			url: "http://www.slicingpsdtohtml.com/source/process_footer.php",	
			
			//GET method is used
			type: "get",

			//pass the data			
			data: data,		
			
			//Do not cache the page
			cache: false,
			
			//success
			success: function (html) {				
				//if process.php returned 1/true (send mail success)
				if (html !='0') {					
					//hide the form
					jQuery('#footer-form-main #footer-form-main-process').fadeOut("fast");
					//show the success message
					jQuery('.done_footer').fadeIn("slow");
					jQuery('.done_footer').html(html);
				//if process.php returned 0/false (send mail failed)
				} else alert('Sorry, unexpected error. Please try again later.');				
			}		
		});
		
		//cancel the submit button default behaviours
		return false;
	});	
	jQuery('#mid-contant-left-contact a.contact').click(function () {	
		//Get the data from all the fields
		var name = jQuery('input[name=contact_fname]');
		var email = jQuery('input[name=contact_email]');
		var capcha = jQuery('input[name=contact_verify]');
		var comments = jQuery('textarea[name=contact_comments]');
		var ans1 = jQuery('#q_u_1');
		var ans2 = jQuery('#q_u_2');
		//Simple validation to make sure user entered something
		//If error found, add hightlight class to the text field
		if (name.val()=='') {
			name.addClass('hightlight');
			return false;
		} else name.removeClass('hightlight');
		
		if (email.val()=='') {
			email.addClass('hightlight');
			return false;
		}else if (email.val().indexOf('@') == -1 || email.val().indexOf('.') == -1 || email.val().indexOf(' ') >= 0) {
			email.addClass('hightlight');
			return false;
		} else email.removeClass('hightlight');
		if (comments.val()=='') {
			comments.addClass('hightlight');
			return false;
		}else comments.removeClass('hightlight');
		if (capcha.val() != (parseInt(ans1.html())+parseInt(ans2.html()))) {
			capcha.addClass('hightlight');
			return false;
		} else capcha.removeClass('hightlight');
		
		//organize the data properly
		var data = 'name=' + name.val() + '&email=' + email.val() + '&comments='+ encodeURIComponent(comments.val());
		
		//disabled all the text fields
		jQuery('#mid-contant-left-contact h4 input[type=text], #mid-contant-left-contact h4 textarea').attr('disabled','true');
//		jQuery('.selecter').attr('disabled','true');
		//show the loading sign
		jQuery('#mid-contant-left-contact .loading').show();
		//start the ajax
		jQuery.ajax({
			//this is the php file that processes the data and send mail
			url: "http://www.slicingpsdtohtml.com/source/process_contact.php",	
			
			//GET method is used
			type: "get",

			//pass the data			
			data: data,		
			
			//Do not cache the page
			cache: false,
			
			//success
			success: function (html) {				
				//if process.php returned 1/true (send mail success)
				if (html !='0') {					
					//hide the form
					jQuery('#mid-contant-left-contact #mid-contant-left-contact-process').fadeOut("fast");
					//show the success message
					jQuery('.done_contact').fadeIn("slow");
					jQuery('.done_contact').html(html);
				//if process.php returned 0/false (send mail failed)
				} else alert('Sorry, unexpected error. Please try again later.');				
			}		
		});
		
		//cancel the submit button default behaviours
		return false;
	});	
});
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //TOP ORDER FORM FLOADING MENU++++++++++++++++++++++++++++++

jQuery(function(){
			//demo 1
			jQuery('#form select#pageno').selectToUISlider();
			jQuery('#form select#turnaround').selectToUISlider();
			jQuery('#form select#implementation').selectToUISlider();
			
					
			//demo 2
		//	$('select#valueA, select#valueB').selectToUISlider();
		
			//demo 3
		//	$('select#valueAA, select#valueBB').selectToUISlider({
		//		labels: 12
		//	});
			
			//fix color 
			fixToolTipColor();
		});
		//purely for theme-switching demo... ignore this unless you're using a theme switcher
		//quick function for tooltip color match
		function fixToolTipColor(){
			//grab the bg color from the tooltip content - set top border of pointer to same
			jQuery('.ui-tooltip-pointer-down-inner').each(function(){
				var bWidth = jQuery('.ui-tooltip-pointer-down-inner').css('borderTopWidth');
				var bColor = jQuery(this).parents('.ui-slider-tooltip').css('backgroundColor')
				jQuery(this).css('border-top', bWidth+' solid '+bColor);
			});	
		}
		
var params = { wmode: "transparent"};
swfobject.embedSWF("http://www.slicingpsdtohtml.com/orage.swf", "orange", "303", "301", "9.0.0", "http://www.slicingpsdtohtml.com/expressInstall.swf",'',params,'');

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++EXAMPLES+++++++++++++++++++++++++++++++++++++++++++++
jQuery(document).ready(function() {

	//Custom settings
	var style_in = 'easeOutBounce';
	var style_out = 'easeInExpo';
	var speed_in = 800;
	var speed_out = 700;	

	//Top and bottom
	var	top = jQuery('.qitem').height() * (-1); 
	var	bottom = jQuery('.qitem').height(); 

	jQuery('.qitem').each(function () {

		//retrieve all the details of the image before removing it
		url = jQuery(this).find('a').attr('href');
		img = jQuery(this).find('img').attr('src');
		alt = jQuery(this).find('img').attr('img');
		width = jQuery(this).width() / 8; 
		height = jQuery(this).height(); 
		
		//remove the image and append 4 div into it
		jQuery('img', this).remove();
		jQuery(this).append('<div class="bar1"></div><div class="bar2"></div><div class="bar3"></div><div class="bar4"></div><div class="bar5"></div><div class="bar6"></div><div class="bar7"></div><div class="bar8"></div>');
		
		//set the image as background image to all the bars
		jQuery(this).children('div').css('background-image','url('+ img + ')');

		//Divide the image into 4 bars and rebuild the image
		jQuery(this).find('div.bar1').css({top:0, left:0, width:width, height:height, backgroundPosition:'0 0' });	
		jQuery(this).find('div.bar2').css({top:0, left:width, width:width, height:height, backgroundPosition:(width*-1) + 'px 0' });	
		jQuery(this).find('div.bar3').css({bottom:0, left:width*2, width:width, height:height, backgroundPosition:(width*-2) + 'px 0' });	
		jQuery(this).find('div.bar4').css({bottom:0, left:width*3, width:width , height:height, backgroundPosition:(width*-3) + 'px 0' });
		jQuery(this).find('div.bar5').css({bottom:0, left:width*4, width:width , height:height, backgroundPosition:(width*-4) + 'px 0' });
		jQuery(this).find('div.bar6').css({bottom:0, left:width*5, width:width , height:height, backgroundPosition:(width*-5) + 'px 0' });
		jQuery(this).find('div.bar7').css({bottom:0, left:width*6, width:width , height:height, backgroundPosition:(width*-6) + 'px 0' });
		jQuery(this).find('div.bar8').css({bottom:0, left:width*7, width:width , height:height, backgroundPosition:(width*-7) + 'px 0' });

	}).hover(function () {
		
		//Move those bar, 1st and 3rd move upward, 2nd and 4th move downward
		jQuery(this).find('div.bar1').stop(false, true).animate({top:top}, {duration:speed_out, easing:style_out});	
		jQuery(this).find('div.bar2').stop(false, true).animate({top:bottom}, {duration:speed_out, easing:style_out});	
		jQuery(this).find('div.bar3').stop(false, true).animate({top:top}, {duration:speed_out, easing:style_out});	
		jQuery(this).find('div.bar4').stop(false, true).animate({top:bottom}, {duration:speed_out, easing:style_out});	
		jQuery(this).find('div.bar5').stop(false, true).animate({top:top}, {duration:speed_out, easing:style_out});	
		jQuery(this).find('div.bar6').stop(false, true).animate({top:bottom}, {duration:speed_out, easing:style_out});	
		jQuery(this).find('div.bar7').stop(false, true).animate({top:top}, {duration:speed_out, easing:style_out});	
		jQuery(this).find('div.bar8').stop(false, true).animate({top:bottom}, {duration:speed_out, easing:style_out});	
		
				
				
	},
	
	function () {

		//Back to default position
		jQuery(this).find('div.bar1').stop(false, true).animate({top:0}, {duration:speed_in, easing:style_in});	
		jQuery(this).find('div.bar2').stop(false, true).animate({top:0}, {duration:speed_in, easing:style_in});	
		jQuery(this).find('div.bar3').stop(false, true).animate({top:0}, {duration:speed_in, easing:style_in});	
		jQuery(this).find('div.bar4').stop(false, true).animate({top:0}, {duration:speed_in, easing:style_in});	
		jQuery(this).find('div.bar5').stop(false, true).animate({top:0}, {duration:speed_in, easing:style_in});	
		jQuery(this).find('div.bar6').stop(false, true).animate({top:0}, {duration:speed_in, easing:style_in});	
		jQuery(this).find('div.bar7').stop(false, true).animate({top:0}, {duration:speed_in, easing:style_in});	
		jQuery(this).find('div.bar8').stop(false, true).animate({top:0}, {duration:speed_in, easing:style_in});	

	
	}).click (function () {
		popup(jQuery(this).find('a').attr('href'));
		//make the whole box clickable
	});

});


function popup(url) 
{
 params  = 'width='+screen.width;
 params += ', height='+screen.height;
 params += ', toolbars=no,menubar=no,location=no';
 params += ', top=0, left=0'
 params += ', fullscreen=yes';


 newwin=window.open(url,'windowname4', params);
 if (window.focus) {newwin.focus()}
 return false;
}

//++++++++++++++++++++++++++++++++++++++++++++++++++++++
