﻿function fontZoom(size)
{
	document.getElementById('Content').style.fontSize=size+'px'
}

var iCheck = 0 ;
function SelectAll(theForm,edition)
{

	var cancel;
	var Selectall;
	cancel="Cancel";
	Selectall="Select all";
	
	if (iCheck==0)
	{
		for (var i=0;i<theForm.elements.length;i++)
		{
			theForm.elements[i].checked = true ;
			iCheck = 1 ;
			theForm.selectall.value = cancel ;
			
		}
	}
	else
	{
		for (var i=0;i<theForm.elements.length;i++)
		{
			theForm.elements[i].checked = false ;
			iCheck = 0 ;
			theForm.selectall.value = Selectall ;
		}
	}
}

function SwitchMenu(SortCount,AllCount)
{
var ss;
for (i=1;i<=AllCount;i++)
{
	ss=eval("Sort1_"+i);
	if (SortCount==i)
	{
		ss.style.display ="";
	}
	else
		ss.style.display ="none";
}
}

function SwitchMenu1(SortCount,SortCount1,AllCount1)
{
var ss,bts;
ss=eval("Sort1_"+SortCount);
ss.style.display ="";
for (i=1;i<=AllCount1;i++)
{
	ss1=eval("Sort_"+SortCount+"_"+i);
	if (SortCount1==i)
	{
		ss1.style.display ="";
	}
	else
		ss1.style.display ="none";
}
}

function SwitchMenuBBS(SortCount,AllCount){
var ss;
for (i=1;i<=AllCount;i++)
{
	ss=eval("aa"+i);
	if (SortCount==i)
	{
		if (ss.style.display =="")
			ss.style.display ="none";
		else 
			ss.style.display ="";
	}
	else
		ss.style.display ="none";
}
}

function showDiv(objId){
	var objDiv=document.getElementById(objId);
	if(objDiv.style.display=="none")
	{
		objDiv.style.display="";
	}else{
		objDiv.style.display="none";
	}
}


function send_inquiry(HomePage)
{
	var ls = document.getElementsByName('ProductID');
	var ln=ls.length;
	var ids_str='';
	for(var i=0;i<ln;i++){
		if(ls[i].checked ==true){
			ids_str +=ls[i].value+"|";
		}
	}
	if(ids_str == ""){
		alert("Your have not select a product!");
		return false;
	}
	//ListForm.action = "putbasket.asp";
//    ListForm.submit();
	$.ajax({
		type:"Post",
		url:HomePage+"ajax.asp?action=AddBasket&productid_str="+ids_str,
		data:"num="+Math.round(Math.random()*10000),
		error:function(){alert("Error!");},
		success:function(){
			alert("The products you selected have been put in the inquired basket!");
		}
	});
}

function SproAdd(ids_str,HomePage)
{
	$.ajax({
		type:"Post",
		url:HomePage+"ajax.asp?action=AddBasket&productid_str="+ids_str,
		data:"num="+Math.round(Math.random()*10000),
		error:function(){alert("Error!");},
		success:function(){
			alert("The products you selected have been put in the inquired basket!");
		}
	});
}

