function conf()
{
  if( confirm( 'Are you sure?' ) ) return true
  else return false;
}

function void_()
{
}


function openAWindow( pageToLoad, winName, width, height, center) {
  xposition=0; yposition=0;
  if ((parseInt(navigator.appVersion) >= 4 ) &&(center)) {
   xposition = (screen.width - width) / 2;
   yposition = (screen.height - height) / 2;
  }
  args = "width=" + width + ","
  + "height=" + height + ","
  + "location=0,"
  + "menubar=0,"
  + "resizable=0,"
  + "scrollbars=0,"
  + "status=0,"
  + "titlebar=0,"
  + "toolbar=0,"
  + "hotkeys=0,"
  + "screenx=" + xposition + "," //NN Only
  + "screeny=" + yposition + "," //NN Only
  + "left=" + xposition + "," //IE Only
  + "top=" + yposition; //IE Only
  window.open( pageToLoad, winName, args );
}
function openAWindow2( pageToLoad, winName, width, height, center) {
  xposition=0; yposition=0;
  if ((parseInt(navigator.appVersion) >= 4 ) &&(center)) {
   xposition = (screen.width - width) / 2;
   yposition = (screen.height - height) / 2;
  }
  args = "width=" + width + ","
  + "height=" + height + ","
  + "location=0,"
  + "menubar=0,"
  + "resizable=0,"
  + "scrollbars=1,"
  + "status=0,"
  + "titlebar=0,"
  + "toolbar=0,"
  + "hotkeys=0,"
  + "screenx=" + xposition + "," //NN Only
  + "screeny=" + yposition + "," //NN Only
  + "left=" + xposition + "," //IE Only
  + "top=" + yposition; //IE Only
  window.open( pageToLoad, winName, args );
}

function xget(id) {
	if(document.getElementById) return document.getElementById(id);
	if(document.all) return document.all[id];
	return null;
}

  function makeHttpRequest(url, callback_function, return_xml,nnn) {
	  var http_request = false;

	  if (window.XMLHttpRequest) { // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType && return_xml == 'xml') {
				 http_request.overrideMimeType('text/xml');
			}
	  } else if (window.ActiveXObject) { // IE
			try {
				 http_request = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				 try {
					  http_request = new ActiveXObject("Microsoft.XMLHTTP");
				 } catch (e) {}
			}
	  }

	  if (!http_request) {
			alert('Unfortunately your browser doesn\'t support this feature.');
			return false;
	  }

	  http_request.onreadystatechange = function() {
			if (http_request.readyState == 4) {
				 if (http_request.status == 200) {
					  if (return_xml == 'xml') {
							eval(callback_function + '(http_request.responseXML,\''+nnn+'\')');
					  } else {
							eval(callback_function + '(http_request.responseText,\''+nnn+'\')');
					  }
				 } else {
					  alert('There was a problem with the request. (Code: ' + http_request.status + ')');
				 }
			}
	  }
	  http_request.open('GET', url, true);
	  http_request.send(null);
  }
  
  function getTestimonial(stat,nnn) {
	var obj=document.getElementById('model'+nnn);
	while (obj.options.length>1)
		obj.remove(1);

	obj.options[0]=new Option("Please Wait!!!","");

	obj.selectedIndex=obj.options.length-1;
	obj.disabled=true;  
   makeHttpRequest('checkProduct.asp?id_parent='+stat, 'displayTestimonial', 'text',nnn);
}

var ua = navigator.userAgent.toLowerCase(); 
var isOpera = (ua.indexOf('opera')  > -1); 
var isIE = (!isOpera && ua.indexOf('msie') > -1); 
  
function getDocumentHeight() { 
return Math.max(document.compatMode != 'CSS1Compat' ? document.body.scrollHeight : document.documentElement.scrollHeight, getViewportHeight()); 
} 
function getDocumentWidth() { 
return Math.max(document.compatMode != 'CSS1Compat' ? document.body.scrollWidth : document.documentElement.scrollWidth, getViewportWidth()); 
} 
function getViewportHeight() { 
	return ((document.compatMode || isIE) && !isOpera) ? (document.compatMode == 'CSS1Compat') ? document.documentElement.clientHeight : document.body.clientHeight : (document.parentWindow || document.defaultView).innerHeight; 
}
function getViewportWidth() { 
	return ((document.compatMode || isIE) && !isOpera) ? (document.compatMode == 'CSS1Compat') ? document.documentElement.clientWidth : document.body.clientWidth : (document.parentWindow || document.defaultView).innerWidth; 
}
function getBodyScrollTop() {
  return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}


function displayTestimonial(text,nnn) {   
	obj=document.getElementById('model'+nnn);
	obj.disabled=false;
	obj.selectedIndex=obj.options.length-1;
	while (obj.options.length>1)
		obj.remove(1);   
	eval(text);		
}

function show_photo(id,id2,k) {   
	if (xget('image_temp') && xget('img_'+k)) {
		close_essay();
		v=xget('img_'+k).src.replace("/thumb110","")
		xget('image_temp').innerHTML='<img src="' + v + '" alt="" border=0 width=640 >';
		for (i=1;i<=5;i++)
		{
			if (xget('img_'+i)) xget('img_'+i).style.border="1px #515151 solid";
		}
		if (xget('img_'+k)) xget('img_'+k).style.border="1px red solid";
	}
}

function show_essay() {   
	if (xget('image_temp') && xget('bio')) {
		xget('image_temp').style.display="none";
		xget('bio').style.display="block";
	}
}

function close_essay() {   
	if (xget('image_temp') && xget('bio')) {
		xget('bio').style.display="none";
		xget('image_temp').style.display="block";
	}
}

function close_detail() {   
	if (xget('detail')) {
		close_essay();
		xget('detail').style.display="none";
		
		if (xget('popuptableBG')) {
			xget('popuptableBG').style.height=getDocumentHeight()+'px';
			xget('popuptableBG').style.display='none';
		}
		
	}
}


function show_detail(id) {
xget('detail').style.left=(document.body.clientWidth/2-386)+'px';
xget('detail').style.display='block';
   makeHttpRequest('getdetail.asp?id='+id+'&rand='+Math.random(), 'displaydetail', 'text',id);
}

function show_detail_new(id,i) {
xget('detail').style.left=(document.body.clientWidth/2-386)+'px';
xget('detail').style.display='block';
makeHttpRequest('getdetail_w.asp?id='+id+'&numb='+i+'&rand='+Math.random(), 'displaydetail', 'text',id);
}

function show_detail2(id) {
xget('detail').style.left=(document.body.clientWidth/2-415)+'px';
xget('detail').style.display='block';
   makeHttpRequest('getdetail2.asp?id='+id+'&rand='+Math.random(), 'displaydetail', 'text',id);
}

function show_detail_new2(id,i) {
xget('detail').style.left=(document.body.clientWidth/2-415)+'px';
xget('detail').style.display='block';
makeHttpRequest('getdetail_w2.asp?id='+id+'&numb='+i+'&rand='+Math.random(), 'displaydetail', 'text',id);
}


function displaydetail(text,id) {
	eval(text);
	if (xget('popuptableBG')) {
		xget('popuptableBG').style.height=getDocumentHeight()+'px';
		xget('popuptableBG').style.display='block';
		xget('popuptableBG').onclick=function(){close_detail();};
	}
}

function vote(id,email) {
   makeHttpRequest('vote.asp?id='+id+'&mmmmm='+email+'&rand='+Math.random(), 'displayvote', 'text',id);
}

function displayvote(text,id) {
	eval(text);
}

