function windowWidth() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return (myWidth);
}



$(document).ready(function(){
	$('.socialMedia').css({'display':'block'});
     if ($('.specificHolder').length != 0) {
        $(".specificHolder").carousel({ 

				pagination: true,

				autoSlide: true

		});
	 }
	 if ($('.mainSlider').length != 0) {
		$(".mainSlider #holderSlider").carousel({ 

				pagination: true,

				autoSlide: true

		});
	}
	
	$(function()
	{
		if ($('.servicesMenu .lvl').length > 0) {
			
			var path = window.location;
			$('.servicesMenu .lvl .servicesMenu li a').each(function() {
				if ($(this).attr('href') == path) {
					$(this).focus();
				}
			});
			$('.servicesMenu .lvl').jScrollPane(
								{
									horizontalDragMinWidth: 64,
									horizontalDragMaxWidth: 64
								}
								);
		}
	});
	
	
	
	$('.form1 .styled').change(function() {
	//alert("sdf");
		val = $(".styled :selected").text();
		$('.form1 #select').html(val); 
		val1 = $(".styled :selected").text();
	
	});
	
	$('.form2 .styledx').change(function() {
	//alert("sdf");
		val = $(".styledx :selected").text();
		$('.form2 #select').html(val); 
		val1 = $(".styledx :selected").text();
	
	});
	
	
    });
	
	
	
	//var width = windowWidth()-17;
	
	//var ie7 = (document.all && !window.opera && window.XMLHttpRequest) ? true : false;
	
	//var the_img = $(".thumbnail");
	
	//ResizeImage(the_img, 1100);
	
	//the_img.css("display","block");

	$(document).ready(function(){
     if ($('.sideSlider').length != 0) {
        $(".sideSlider").carousel({ 

				pagination: true,

				autoSlide: true

		});
	 }
    });

	

	$(document).ready(function(){
     if ($('.sideSlider_services').length != 0) {
        $(".sideSlider_services").carousel({ 

				pagination: true,

				autoSlide: true

		});
	 }
    });







var SITE = SITE || {};  SITE.fileInputs = function() {   var $this = $(this),       $val = $this.val(),       valArray = $val.split('\\'),       newVal = valArray[valArray.length-1],       $button = $this.siblings('.button'),       $fakeFile = $this.siblings('.file-holder');   if(newVal !== '') {     $button.text(newVal);      } };

$(document).ready(function() {

  $('.file-wrapper input[type=file]').bind('change focus click', SITE.fileInputs);

});


var value;

$(document).ready(function() {

	$('#name').focus(function() {

		if($(this).val() == "name *") {

			value=$(this).val();

			$(this).val("");

		}

	});
	
	$('#file').change(function() {
		var y = $('#file').val();
		//var element = y.str.split('\'); 
		//alert(element[0]);
		$('#uploadtext').html(y);
	});

	$('#name').blur(function() {

		if($(this).val()=="") {

			$(this).val("name *");

		}

	});

	$('#email').focus(function() {

		if($(this).val() == "email *") {

			value=$(this).val();

			$(this).val("");

		}

	});

	$('#email').blur(function() {

		if($(this).val()=="") {

			$(this).val("email *");

		}

	});

	$(".wpcf7-form").submit(function() {

		if ($("#name").val() == "name *") {

			$("#name").val("");

		}

		if ($("#email").val() == "email *") {

			$("#email").val("");

		}

		
		/*if ($('select#type option:selected').val() == "type of user *") {

			$("select#type option[selected]").removeAttr("selected");

			$("select#type option[value='---']").attr("selected", "selected"); 

		}*/

	});	    

	//$("select#type option[selected]").removeAttr("selected");

	//$("select#type option[value='type of user *']").attr("selected", "selected");    

	

		

});


