// JavaScript Document
// coded by slamz 2007.10.17
function mOpenWindow(type,winName,features,idendity) { //v2.0
  if(type == "1"){
  	var i,j,check,tURL,theURL;
  	tURL = "http://ex.qianjia.com/qianjiavote/vProcess.aspx?vote_id="+idendity+"&proc=vote";
	theURL = tURL;
	j=0;
	
	var form1 = document.getElementById("form1");
	if(form1==null)form1 = document.getElementByName("form1");
	if(form1==null){
		alert("Can't find form1");
		return;
	}
	mcheck = form1.getElementsByTagName('input');
	if(mcheck==null){
		alert("Can't find options");
		return;
	}else{
		
		if(mcheck.length){
			for(i=0;i<=mcheck.length-1;i++){
				if(mcheck[i].name='checkbox'&&mcheck[i].checked==true){
					theURL = theURL + "&c" + j + "=" + mcheck[i].value;
					j++;
				}
			}
			if(theURL==tURL){
				alert("Please select one option");
				return;
			}
			else{
				theURL = theURL + "&count=" + j;
			}
		}
	}
  }
  
  if(type == "2"){
  	theURL = "http://ex.qianjia.com/qianjiavote/vResult.aspx?vote_id="+idendity;
  }
   	window.open(theURL,winName,features);
}


