var b=false;
var bD = false;

function mOvr(src, clrOver)
     {
//     if(!src.contains(event.fromElement))
     {src.style.cursor="hand";
     src.bgColor = clrOver;
     }
     }
 function mOut(src, clrIn)
 {
//	if(!src.contains(event.toElement))
	{
	src.style.cursor="default" ;
	src.bgColor=clrIn; 
	}
 }

function WriteSth()
{
document.write("<table width=\"200\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\" class=\"ctbmenu\">");

/*
document.write("<tr><td class=\"ctd1\" onmouseout=\"mOut(this,'#F3F5F7');\" onmouseover=\"mOvr(this,'#D2DAE3');\"><a href=\"http://www.qweas.com/topdownloads.html\" class=\"g2\">Top Downloads</a></td></tr>");
document.write("<tr><td class=\"ctd1\" onmouseout=\"mOut(this,'#F3F5F7');\" onmouseover=\"mOvr(this,'#D2DAE3');\"><a href=\"http://www.qweas.com/topsales.html\" class=\"g2\">Top Sales</a></td></tr>");
document.write("<tr><td class=\"ctd1\" onmouseout=\"mOut(this,'#F3F5F7');\" onmouseover=\"mOvr(this,'#D2DAE3');\"><a href=\"http://www.qweas.com/editpicks.html\" class=\"g2\">Editors Picks</a></td></tr>");
document.write("<tr><td class=\"ctd1\" onmouseout=\"mOut(this,'#F3F5F7');\" onmouseover=\"mOvr(this,'#D2DAE3');\"><a href=\"http://www.qweas.com/sitemap.html\" class=\"g2\">Qweas Sitemap</a></td></tr>");
document.write("<tr><td class=\"ctd1\" onmouseout=\"mOut(this,'#F3F5F7');\" onmouseover=\"mOvr(this,'#D2DAE3');\"><a href=\"http://www.qweas.com/discounts.html\" class=\"g2\">Special Discounts</a></td></tr>");
document.write("<tr><td class=\"ctd1\" onmouseout=\"mOut(this,'#F3F5F7');\" onmouseover=\"mOvr(this,'#D2DAE3');\"><a href=\"http://www.qweas.com/links.html\" class=\"g2\">Partner Links</a></td></tr>");
document.write("<tr><td class=\"ctd1\" onmouseout=\"mOut(this,'#F3F5F7');\" onmouseover=\"mOvr(this,'#D2DAE3');\"><a href=\"http://www.qweas.com/buttons.html\" class=\"g2\">Get Buttons</a></td></tr>");
document.write("<tr><td class=\"ctd1\" onmouseout=\"mOut(this,'#F3F5F7');\" onmouseover=\"mOvr(this,'#D2DAE3');\"><a href=\"http://www.qweas.com/award.html\" class=\"g2\">Get Award Images</a></td></tr>");
document.write("<tr><td class=\"ctd1\" onmouseout=\"mOut(this,'#F3F5F7');\" onmouseover=\"mOvr(this,'#D2DAE3');\"><a href=\"http://www.qweas.com/more.html\" class=\"g2\">More about Qweas...</a></td></tr>");
document.write("<tr><td  onmouseout=\"mOut(this,'#F3F5F7');\" onmouseover=\"mOvr(this,'#D2DAE3');\"><a href=\"http://www.qweas.com/more.html\" class=\"g2\">Register a button</a></td></tr>");
*/

document.write("<tr><td class=\"ctd1\" onmouseout=\"mOut(this,'#F3F5F7');\" onmouseover=\"mOvr(this,'#D2DAE3');\"><a href=\"http://www.qweas.com/about/popular.html\" class=\"g2\">Top Downloads</a></td></tr>");
document.write("<tr><td class=\"ctd1\" onmouseout=\"mOut(this,'#F3F5F7');\" onmouseover=\"mOvr(this,'#D2DAE3');\"><a href=\"http://www.qweas.com/about/editorpicks.html\" class=\"g2\">Editors Picks</a></td></tr>");
document.write("<tr><td class=\"ctd1\" onmouseout=\"mOut(this,'#F3F5F7');\" onmouseover=\"mOvr(this,'#D2DAE3');\"><a href=\"http://www.qweas.com/about/sitemap.html\" class=\"g2\">Qweas Sitemap</a></td></tr>");
document.write("<tr><td class=\"ctd1\" onmouseout=\"mOut(this,'#F3F5F7');\" onmouseover=\"mOvr(this,'#D2DAE3');\"><a href=\"http://www.qweas.com/developer/award.htm\" class=\"g2\">Get Award Images</a></td></tr>");
document.write("<tr><td class=\"ctd1\" onmouseout=\"mOut(this,'#F3F5F7');\" onmouseover=\"mOvr(this,'#D2DAE3');\"><a href=\"http://go.qweas.com/\" class=\"g2\">Make Long URL Short...</a></td></tr>");
document.write("<tr><td class=\"ctd1\" onmouseout=\"mOut(this,'#F3F5F7');\" onmouseover=\"mOvr(this,'#D2DAE3');\"><a href=\"http://www.qweas.com/about/about.html\" class=\"g2\">More about Qweas...</a></td></tr>");
document.write("<tr><td  onmouseout=\"mOut(this,'#F3F5F7');\" onmouseover=\"mOvr(this,'#D2DAE3');\"><a href=\"http://www.qweas.com/about/contact.html\" class=\"g2\">Contact Us</a></td></tr>");

document.write("</table>");

}


function SetFocus(n)
{
	if(n==0)
	{
	document.getElementById("tdSoftware").className="cFocusSoftware";
	document.getElementById("tdDiscount").className="cNormalDiscount";
	document.getElementById("tdCompany").className="cNormalCompany";
	document.getElementById("divDiscount").style.display="none";
	document.getElementById("divCompany").style.display="none";
	document.getElementById("divSoftware").style.display="";
	}

	if(n==1)
	{
	document.getElementById("tdSoftware").className="cNormalSoftware";
	document.getElementById("tdDiscount").className="cFocusDiscount";
	document.getElementById("tdCompany").className="cNormalCompany";
	document.getElementById("divCompany").style.display="none";
	document.getElementById("divSoftware").style.display="none";
	document.getElementById("divDiscount").style.display="";
	}

	if(n==2)
	{
	document.getElementById("tdSoftware").className="cNormalSoftware";
	document.getElementById("tdDiscount").className="cNormalDiscount";
	document.getElementById("tdCompany").className="cFocusCompany";
	document.getElementById("divSoftware").style.display="none";
	document.getElementById("divDiscount").style.display="none";
	document.getElementById("divCompany").style.display="";
	}

}

function showMenu()
{
	document.getElementById("divAbout").style.display="";	
	b=true;
}

function hideMenu()
{
	if(b==false)return;
	var t=setTimeout("hideMenu2()",200);
}

function hideMenu2()
{
	if(bD==true)return;
	document.getElementById("divAbout").style.display="none";	
	b=false;
}

function JudeOutDiv(e)
{
	var l = document.getElementById("divAbout").offsetLeft;
	var t = document.getElementById("divAbout").offsetTop;
	var w = document.getElementById("divAbout").offsetWidth;
	var h = document.getElementById("divAbout").offsetHeight;


	if(e.clientX<=l || e.clientX>=l+w || e.clientY>=t+h || e.clientY<=t)bD=false;
	else bD=true;
	if(bD==false && b==true)hideMenu2();
}


function Sponsor(szMain)
{
	document.write("<font color=\"#A0A0A0\" size=\"2\"><b>Sponsor Links</b></font><font size=1 face=verdana> <br /><br />");
	var a="<a href=\"http://pocket.qweas.com/ipod/imtoo_ipod_computer_transfer_for_mac.htm\" class=\"g2\">iPod Computer Transfer for Mac</a><font style='font: 4pt arial'><br /><br /></font>";
	var b="<a href=\"http://www.qweas.com/download/audio_mp3/audio_converters/protected_music_converter.htm\" class=\"g2\">Protected Music Converter</a><font style='font: 4pt arial'><br /><br /></font>";
	var c="<a href=\"http://www.qweas.com/download/audio_mp3/audio_converters/applemacsoft_drm_converter_for_mac.htm\" class=\"g2\">DRM Converter for Mac</a><font style='font: 4pt arial'><br /><br /></font>";
	var d="<a href=\"http://www.qweas.com/download/video_dvd/video_converters/video_converter_for_mac.htm\" class=\"g2\">Video Converter for Mac</a><font style='font: 4pt arial'><br /><br /></font>";
	var e="<a href=\"http://www.qweas.com/download/audio_mp3/audio_converters/soundtaxi.htm\" class=\"g2\">SoundTaxi</a><font style='font: 4pt arial'><br /><br /></font>";
	var f="<a href=\"http://www.qweas.com/download/video_dvd/video_converters/mp4_converter_for_mac.htm\" class=\"g2\">MP4 Converter for Mac</a><font style='font: 4pt arial'><br /><br /></font>";
	var g="<a href=\"http://www.qweas.com/download/video_dvd/dvd_burners/dvd_creator_for_mac.htm\" class=\"g2\">DVD Creator for Mac</a><font style='font: 4pt arial'><br /><br /></font>";
	var h="<a href=\"http://www.qweas.com/download/audio_mp3/audio_converters/soundtaxi_professional.htm\" class=\"g2\">SoundTaxi Professional</a><font style='font: 4pt arial'><br /><br /></font>";
	var i="<a href=\"http://www.qweas.com/download/video_dvd/dvd_rippers/isofter_dvd_to_youtube_converter.htm\" class=\"g2\">DVD to YouTube Converter</a><font style='font: 4pt arial'><br /><br /></font>";
	var j="<a href=\"http://pocket.qweas.com/mobile/tansee_iphone_transfer_sms.htm\" class=\"g2\">iPhone Transfer SMS</a><font style='font: 4pt arial'><br /><br /></font>";
	var k="<a href=\"http://www.qweas.com/download/video_dvd/video_converters/imtoo_video_converter_for_mac.htm\" class=\"g2\">ImTOO Video Converter for Mac</a><font style='font: 4pt arial'><br /><br /></font>";
	var l="<a href=\"http://www.qweas.com/download/video_dvd/video_converters/xilisoft_mp4_converter_for_mac.htm\" class=\"g2\">Xilisoft MP4 Converter for Mac</a><font style='font: 4pt arial'><br /><br /></font>";
	var m="<a href=\"http://www.qweas.com/download/video_dvd/video_converters/daniusoft_digital_media_converter.htm\" class=\"g2\">Daniusoft Media Converter</a><font style='font: 4pt arial'><br /><br /></font>";
	
	switch(szMain)
	{
	case "audio":
		document.write(a);
		document.write(b);
		document.write(c);
		document.write(d);
		document.write(e);
		document.write(f);
		document.write(g);
		document.write(h);
		document.write(i);
		document.write(j);
		document.write(k);
		document.write(l);
		document.write(m);
		break;
	
	case "business":
		document.write(a);
		document.write(b);
		document.write(c);
		document.write(d);
		document.write(e);
		document.write(f);
		document.write(g);
		document.write(h);
		document.write(i);
		document.write(j);
		document.write(k);
		document.write(l);
		document.write(m);
		break;

	case "communications":
		document.write(a);
		document.write(b);
		document.write(c);
		document.write(d);
		document.write(e);
		document.write(f);
		document.write(g);
		document.write(h);
		document.write(i);
		document.write(j);
		document.write(k);
		document.write(l);
		document.write(m);
		break;

	case "desktop":
		document.write(a);
		document.write(b);
		document.write(c);
		document.write(d);
		document.write(e);
		document.write(f);
		document.write(g);
		document.write(h);
		document.write(i);
		document.write(j);
		document.write(k);
		document.write(l);
		document.write(m);
		break;

	case "development":
		document.write(a);
		document.write(b);
		document.write(c);
		document.write(d);
		document.write(e);
		document.write(f);
		document.write(g);
		document.write(h);
		document.write(i);
		document.write(j);
		document.write(k);
		document.write(l);
		document.write(m);
		break;

	case "education":
		document.write(a);
		document.write(b);
		document.write(c);
		document.write(d);
		document.write(e);
		document.write(f);
		document.write(g);
		document.write(h);
		document.write(i);
		document.write(j);
		document.write(k);
		document.write(l);
		document.write(m);
		break;

	case "games":
		document.write(a);
		document.write(b);
		document.write(c);
		document.write(d);
		document.write(e);
		document.write(f);
		document.write(g);
		document.write(h);
		document.write(i);
		document.write(j);
		document.write(k);
		document.write(l);
		document.write(m);
		break;

	case "graphic":
		document.write(a);
		document.write(b);
		document.write(c);
		document.write(d);
		document.write(e);
		document.write(f);
		document.write(g);
		document.write(h);
		document.write(i);
		document.write(j);
		document.write(k);
		document.write(l);
		document.write(m);
		break;

	case "home":
		document.write(a);
		document.write(b);
		document.write(c);
		document.write(d);
		document.write(e);
		document.write(f);
		document.write(g);
		document.write(h);
		document.write(i);
		document.write(j);
		document.write(k);
		document.write(l);
		document.write(m);
		break;

	case "network":
		document.write(a);
		document.write(b);
		document.write(c);
		document.write(d);
		document.write(e);
		document.write(f);
		document.write(g);
		document.write(h);
		document.write(i);
		document.write(j);
		document.write(k);
		document.write(l);
		document.write(m);
		break;

	case "security":
		document.write(a);
		document.write(b);
		document.write(c);
		document.write(d);
		document.write(e);
		document.write(f);
		document.write(g);
		document.write(h);
		document.write(i);
		document.write(j);
		document.write(k);
		document.write(l);
		document.write(m);
		break;

	case "servers":
		document.write(a);
		document.write(b);
		document.write(c);
		document.write(d);
		document.write(e);
		document.write(f);
		document.write(g);
		document.write(h);
		document.write(i);
		document.write(j);
		document.write(k);
		document.write(l);
		document.write(m);
		break;

	case "system":
		document.write(a);
		document.write(b);
		document.write(c);
		document.write(d);
		document.write(e);
		document.write(f);
		document.write(g);
		document.write(h);
		document.write(i);
		document.write(j);
		document.write(k);
		document.write(l);
		document.write(m);
		break;


	case "web":
		document.write(a);
		document.write(b);
		document.write(c);
		document.write(d);
		document.write(e);
		document.write(f);
		document.write(g);
		document.write(h);
		document.write(i);
		document.write(j);
		document.write(k);
		document.write(l);
		document.write(m);
		break;

	default:
		document.write(a);
		document.write(b);
		document.write(c);
		document.write(d);
		document.write(e);
		document.write(f);
		document.write(g);
		document.write(h);
		document.write(i);
		document.write(j);
		document.write(k);
		document.write(l);
		document.write(m);
		break;
	}
}

function TopAd(szMain)
{
	document.write("<table cellpadding=\"3px\" width=\"100%\" height=\"55\" style=\"border: solid 1px #91AECD;font: 7pt verdana\"><tr><td width=\"33%\" align=\"left\">");

	var a="<a href=\"http://pocket.qweas.com/ipod/imtoo_ipod_computer_transfer_for_mac.htm\"><b>iPod Computer Transfer for Mac</b></a><br />Transfer music and video files between iPod/iPhone and Mac<br /><a href=\"http://d2.qweas.com/c/mac/ipod-computer-transfer-for-mac(regnow-54787).dmg\">Download Now</a>";
	var b="<a href=\"http://www.qweas.com/download/audio_mp3/audio_converters/protected_music_converter.htm\"><b>Protected Music Converter</b></a><br />Convert DRM protected music to many audio file formats<br /><a href=\"http://d2.qweas.com/c/audio_mp3/pmconverter.exe\">Download Now</a>";
	var c="<a href=\"http://www.qweas.com/download/video_dvd/video_converters/video_converter_for_mac.htm\"><b>4Media Video Converter for Mac</b></a><br />Convert all video and audio formats on Mac system<br /><a href=\"http://d2.qweas.com/c/mac/m-video-converter-for-mac(regnow-54787).tar\">Download Now</a>";
	var d="<a href=\"http://www.qweas.com/download/video_dvd/video_converters/mp4_converter_for_mac.htm\"><b>4Media MP4 Converter for Mac</b></a><br />Convert most video and audio formats to MP4 on Mac<br /><a href=\"http://d2.qweas.com/c/mac/m-mp4-converter-for-mac(regnow-54787).tar\">Download Now</a>";
	var e="<a href=\"http://www.qweas.com/download/video_dvd/dvd_burners/dvd_creator_for_mac.htm\"><b>DVD Creator for Mac</b></a><br />Create DVD Movie from Video like MPEG, AVI, Divx, etc.<br /><a href=\"http://d1.qweas.com/c/mac/m-dvd-creator-for-mac(regnow-54787).tar\">Download Now</a>";
	var f="<a href=\"http://www.qweas.com/download/video_dvd/dvd_rippers/isofter_dvd_to_youtube_converter.htm\"><b>DVD to YouTube Converter</b></a><br />Convert DVD to YouTube supported video format<br /><a href=\"http://d2.qweas.com/c/video_dvd/idvdtoyoutube.exe\">Download Now</a>";
	var g="<a href=\"http://pocket.qweas.com/mobile/tansee_iphone_transfer_sms.htm\"><b>iPhone Transfer SMS</b></a><br />Transfer iPhone SMS to computer as a txt or ANTS file<br /><a href=\"http://d1.qweas.com/c/pocket/tanseeiphonesms_54787.exe\">Download Now</a>";
	var h="<a href=\"http://www.qweas.com/download/video_dvd/video_converters/imtoo_video_converter_for_mac.htm\"><b>ImTOO Video Converter for Mac</b></a><br />Convert among all video and audio formats on Mac<br /><a href=\"http://d2.qweas.com/c/mac/video-converter-for-mac(regnow-54787).tar\">Download Now</a>";
	var i="<a href=\"http://www.qweas.com/download/video_dvd/video_converters/xilisoft_mp4_converter_for_mac.htm\"><b>Xilisoft MP4 Converter for Mac</b></a><br />Convert most video audio files to MP4 on Mac<br /><a href=\"http://d2.qweas.com/c/mac/x-mp4-converter-for-mac(regnow-54787).tar\">Download Now</a>";
	var j="<a href=\"http://www.qweas.com/download/video_dvd/video_converters/daniusoft_digital_media_converter.htm\"><b>Daniusoft Media Converter</b></a><br />This DRM media converter can convert both DRM audio and DRM video<br /><a href=\"http://d1.qweas.com/c/video_dvd/daniu-digital-media-converter_54787.exe\">Download Now</a>";

	var aa="</td><td width=\"34%\" align=\"left\">";
	var bb="</td><td width=\"33%\" align=\"left\">";

	switch(szMain)
	{
	case "audio":
		document.write(a);
		document.write(aa);
		document.write(b);
		document.write(bb);
		document.write(c);
		break;
	
	case "business":
		document.write(d);
		document.write(aa);
		document.write(e);
		document.write(bb);
		document.write(f);
		break;

	case "communications":
		document.write(g);
		document.write(aa);
		document.write(h);
		document.write(bb);
		document.write(i);
		break;

	case "desktop":
		document.write(j);
		document.write(aa);
		document.write(a);
		document.write(bb);
		document.write(b);
		break;

	case "development":
		document.write(c);
		document.write(aa);
		document.write(d);
		document.write(bb);
		document.write(e);
		break;

	case "education":
		document.write(f);
		document.write(aa);
		document.write(g);
		document.write(bb);
		document.write(h);
		break;

	case "games":
		document.write(i);
		document.write(aa);
		document.write(j);
		document.write(bb);
		document.write(a);
		break;

	case "graphic":
		document.write(b);
		document.write(aa);
		document.write(c);
		document.write(bb);
		document.write(d);
		break;

	case "home":
		document.write(e);
		document.write(aa);
		document.write(f);
		document.write(bb);
		document.write(g);
		break;

	case "network":
		document.write(h);
		document.write(aa);
		document.write(i);
		document.write(bb);
		document.write(j);
		break;

	case "security":
		document.write(a);
		document.write(aa);
		document.write(c);
		document.write(bb);
		document.write(e);
		break;

	case "servers":
		document.write(g);
		document.write(aa);
		document.write(i);
		document.write(bb);
		document.write(a);
		break;

	case "system":
		document.write(b);
		document.write(aa);
		document.write(d);
		document.write(bb);
		document.write(f);
		break;


	case "web":
		document.write(g);
		document.write(aa);
		document.write(i);
		document.write(bb);
		document.write(a);
		break;

	default:
		document.write(c);
		document.write(aa);
		document.write(f);
		document.write(bb);
		document.write(i);
		break;
	}

	document.write("</td></tr></table>");
}





function CountDownload(){
	var params = 'action=downloadcount&f_UID='+document.getElementById('f_UID').value;
	new Ajax.Request('/admin/ajax.asp', {method:'POST', parameters:params, onSuccess:function(transport){
		//var json = transport.responseText.evalJSON(true);
		//if( json.msg == '' )
		//	alert("ok");
		//else
		//	alert(json.msg);
	}});
}



function ChangeIcon(event)
{
var left = 0;
var obj = document.getElementById('yourratestar');
while(obj.offsetParent){
	left += obj.offsetLeft;
	obj = obj.offsetParent;
}
left = event.clientX - document.body.clientLeft - left;
if(left > 28 * 4){
	document.getElementById('yourratestar').src = "/common/css/mid/editor-5star.png";
	document.getElementById('User_Rating').value = 5;
}
else if(left > 28 * 3){
	document.getElementById('yourratestar').src = "/common/css/mid/editor-4star.png";
	document.getElementById('User_Rating').value = 4;
}
else if(left > 28 * 2){
	document.getElementById('yourratestar').src = "/common/css/mid/editor-3star.png";
	document.getElementById('User_Rating').value = 3;
}
else if(left > 28 * 1){
	document.getElementById('yourratestar').src = "/common/css/mid/editor-2star.png";
	document.getElementById('User_Rating').value = 2;
}
else if(left > 2){
	document.getElementById('yourratestar').src = "/common/css/mid/editor-1star.png";
	document.getElementById('User_Rating').value = 1;
}
else{
	document.getElementById('yourratestar').src = "/common/css/mid/editor-0star.png";
	document.getElementById('User_Rating').value = 0;
}
} 

function SubmitRating(){
	var params = 'action=ratingsubmit&f_UID='+document.getElementById('f_UID').value+'&rating='+document.getElementById('User_Rating').value;
	new Ajax.Request('/admin/ajax.asp', {method:'POST', parameters:params, onSuccess:function(transport){
		var json = transport.responseText.evalJSON(true);
		if( json.msg == '' )
			alert("Thank you for rating this software!");
		else
			alert(json.msg);
	}});
}


