// JavaScript Document

 $(document).ready(function() {
   
    // search form
	$("#qs").focus(function () {
          $("#qs").val('');
    });
	 
	$('#cu img').hover(function() {	$(this).addClass('cuhover');}, function() {	$(this).removeClass('cuhover');	});
	$('#gvimg20').hover(function() {$(this).addClass('gvhov');}, function() {	$(this).removeClass('gvhov');	});
	$('#gvimg50').hover(function() {$(this).addClass('gvhov');}, function() {	$(this).removeClass('gvhov');	});
	$('#gvimg75').hover(function() {$(this).addClass('gvhov');}, function() {	$(this).removeClass('gvhov');	});
	$('#gvimg100').hover(function() {$(this).addClass('gvhov');}, function() {$(this).removeClass('gvhov');	});

	 mc5(0);
	 
 });
 
 
 
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
} 
 
 
 
 
 
var photoDir='/wp-content/themes/pv1.5/images/osteo/';
var prevPhoto='';

function goPhotos(n) {
	// take array element 1 till final element
if(typeof(photos=='object')) {
		//
		  for(var i=0; i<photos.length; i++) {
			  	var newImage=photos[i];
				document.newImage = new Image; 
				document.newImage.src = photoDir+newImage+'.jpg';
		  }
		  //
		clearTimeout(timer);
		var msecs=4000;
		
if(prevPhoto=='') { 
// first run
prevPhoto='<img src="'+photoDir+photos[0]+'.jpg" width="280" height="125" alt ="'+photos[0]+'" />'; 
$("#osteophotobox2").html(prevPhoto);
$("#osteophotobox").fadeOut("fast");
}	
	
	if(n<photos.length) {	
	var timer = setTimeout("fadephoto('"+photos[n]+"',"+n+")",msecs);	
	}  
	
}	
}

function fadephoto(photo,n) {
var thisphoto='<img src="'+photoDir+photo+'.jpg" width="280" height="125" alt ="'+photo+'" />';
$("#osteophotobox").html(thisphoto);
$("#osteophotoshadow").fadeIn("slow");

    $("#osteophotobox").fadeIn("slow", function () {
        $("#osteophotobox2").html(thisphoto);
		$("#osteophotobox").fadeOut("fast");
      });

prevPhoto=thisphoto;
goPhotos(n+1);
	
}


mc=new Array()
mc[0]='552763306231554230245260505952602450233060342455302723335730333444';
mc[1]='5734232430395932235932425557596231554230245260505952602450233060342455302723335730333444';

function mc5(e) {
op='';chars='st2-n74opr.uyqz9m:0vwk_5x16hjab3igcdel8@f'; m='39525560243040';
inp=m+mc[e];for(i=0; i<inp.length; i+=2) {id=parseInt(inp.substr(i,2));op+=chars.charAt(id-23);}
$(".mcx").attr("href",op); $(".mcx").text(op.substr(7));
}



