// JavaScript Document

function ConfirmChoice(message,url){ 

answer = confirm(message)

	  if (answer !=0){ 
	   location = url
	  } 
}

/**
 * Get after scrolling pixel range 
 */
function getBodyScrollTop()
{
	return self.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
}

function showPreloader()
{
	var getTop = getBodyScrollTop() + ($('body').height() / 2);
	$('#preloader').css({ position: "absolute", top: getTop });
	$('#preloader').show();
}

/**
 * Function to hide preloader 
 */
function hidePreloader()
{
     $('#preloader').hide();
}

function prForm (theForm,submit) {
		theForm.action.value = "Please wait...";
		theForm.action.disabled = true;
		if (submit) { document.theForm.submit();}
}

function textCounter(field,cntfield,maxlimit)
{
if (field.value.length > maxlimit) // if too long trim it!
   field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
   cntfield.value = maxlimit - field.value.length;
}
function setImage(img){
		document.images["carpict"].src=img;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }    
}

 $(document).ready(function(){
    correctPNG();
  });
  
 jQuery(document).ready(function(){
	$("#list h3").click(function() {
		$(this).next().toggle("slow");
	}).next().hide();
});