var strImagePath = 'http://images.adultmatchdoctor.com/image/';

/*
Disable right click script II (on images)- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com


var clickmessage = "Right click disabled on images!"

function disableclick(e) {
	if (document.all) {
		if (event.button==2||event.button==3) {
			if (event.srcElement.tagName=="IMG") {
				alert(clickmessage);
				return false;
			}
		}
	}
	else if (document.layers) {
		if (e.which == 3) {
			alert(clickmessage);
			return false;
		}
	}
	else if (document.getElementById) {
		if (e.which==3&&e.target.tagName=="IMG") {
			alert(clickmessage);
			return false;
		}
	}
}

function associateimages() {
	for(i=0;i<document.images.length;i++)
	document.images[i].onmousedown = disableclick;
}

if (document.all) {
	document.onmousedown=disableclick
}
else if (document.getElementById) {
	document.onmouseup=disableclick
}
else if (document.layers) {
	associateimages()
}
*/

function new_showDiv(ctrl,intDivNum) 
//intDivNum = 3 - number of divs, named div1,div2,div3 
{
   for (var i=1; i <= intDivNum; i++)
   {
	  var div = document.getElementById('div' + i);
	  var img = document.getElementById('img' + i);
	  if (i == ctrl)
	  {
			if (div.className == 'visible') 
			{
			   div.className = 'hidden';
			   img.src='http://images.adultmatchdoctor.com/image/search/arrow_right.gif';
			}
			else
			{
			   div.className = 'visible';
			   img.src='http://images.adultmatchdoctor.com/image/search/arrow_down.gif';
			}
	  }
	  //else
	  //{
	  //		div.className = 'hidden';
	  //		img.src='http://images.adultmatchdoctor.com/image/search/arrow_right.gif';
	  //}
   }
}

function search_showDiv(ctrl,intDivNum) 
//intDivNum = 3 - number of divs, named div1,div2,div3 
{
	   
	var div = document.getElementById('div' + ctrl);
	var img = document.getElementById('img' + ctrl);

	if (div.className == 'visible') {
		div.className = 'hidden';
		img.src='http://images.adultmatchdoctor.com/image/search/arrow_right.gif';
	} else {
		div.className = 'visible';
		img.src='http://images.adultmatchdoctor.com/image/search/arrow_down.gif';
	}
}

function printProfile(userID) {
   //window.name = "AdultMatchdoctor";
   //?userID=' + userID,
   var newPrint = window.open("printProfile.aspx?userID=" + userID,"PrintProfile","toolbar=no,width=700,height=600,location=no,status=no,scrollbars=yes,resize=yes,menubar=no");
}

function newWindowViewProfile(userID) {
   //window.name = "AdultMatchdoctor";
   //?userID=' + userID,
   var newPrint = window.open("profile" + userID + ".aspx" ,"ViewProfile","toolbar=no,width=800,height=600,location=no,status=no,scrollbars=yes,resize=yes,menubar=no");
}

function viewPhoto(strPhotoURL) {
	var viewPhoto =	window.open("/viewPhoto.aspx?photoURL=" + strPhotoURL, "ViewPhoto", "toolbar=no,width=320,height=300,location=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function doChecks(bVal) {
	var theform;
	if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
		theform = document.Form1;
	}
	else {
		theform = document.forms["Form1"];
	}
	for(i = 0; i < theform.elements.length; i++) {
		elm = theform.elements[i];
        if (elm.type == 'checkbox') {
			elm.checked = bVal;
        } 
	}	
}

function toggleChecks() {
	var theform;
	if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
		theform = document.Form1;
	}
	else {
		theform = document.forms["Form1"];
	}
	if (theform.isChecked.value == "0") {
		doChecks(true);
	} else {
		doChecks(false);
	}

}

function addBookmark(strTitle,strURL) {
	if (window.sidebar) {
		// Mozilla Firefox Bookmark
		window.sidebar.addPanel(strTitle, strURL,"");
	}
	else if ( window.external ) {
		// IE Favorite
		window.external.AddFavorite(strURL, strTitle);
	}
	else if (window.opera && window.print) {
		// Opera Hotlist
		return true;
	}
}

function displayBookmark() {
	if (window.external) {
		document.write('<a href="javascript:addBookmark(\'AdultMatchdoctor.com, Free Adult Personals\',\'http://www.adultmatchdoctor.com\');" title="add us to your browser bookmarks"><img src="http://images.adultmatchdoctor.com/image/buttons/rss/bookmarks.gif" border=0 alt="add us to your browser bookmarks"></a>');
	}
	else  if (window.sidebar) {
		document.write('<a href="javascript:addBookmark(\'AdultMatchdoctor.com, Free Adult Personals\',\'http://www.adultmatchdoctor.com\');" title="add us to your browser bookmarks"><img src="http://images.adultmatchdoctor.com/image/buttons/rss/bookmarks.gif" border=0 alt="add us to your browser bookmarks"></a>');
	}
	else if (window.opera && window.print) {
		document.write('<a href="javascript:addBookmark(\'AdultMatchdoctor.com, Free Adult Personals\',\'http://www.adultmatchdoctor.com\');" title="add us to your browser bookmarks"><img src="http://images.adultmatchdoctor.com/image/buttons/rss/bookmarks.gif" border=0 alt="add us to your browser bookmarks"></a>');
	}
}
