function photo_opener(obj,R_Size,S_Bars,int_Width,int_Height) {
	window.open(obj,null,"resizable=" + R_Size + ",scrollbars=" + S_Bars + ",width=" + int_Width  + ",height=" + int_Height + ",top=10");
}

function popWindow(url, name, width, height) {
	var x = (screen.width - width)/2;
	var y = (screen.height - height)/2;
    var opts = 'height=' + height + ',width=' + width + ",screenX=" + x + ",left=" + x + ",screenY=" + y + ",top=" + y + ',location=no,scrollbars=yes,menubar=no,resizable=yes,status=no,toolbar=no';

    var newWindow = window.open(url, name, opts);
    newWindow.focus();
}

function popWindow2(url, name, width, height) {
	var x = (screen.width - width)/2;
	var y = (screen.height - height)/2;
    var opts = 'height=' + height + ',width=' + width + ",screenX=" + x + ",left=" + x + ",screenY=" + y + ",top=" + y + ',location=no,scrollbars=no,menubar=no,resizable=no,status=no,toolbar=no';

    var newWindow = window.open(url, name, opts);
    newWindow.focus();
}

function cutValue(str,intShow,beginShow,showLength) {
	var temp,tempArr,subTemp;
	var intArr;
	temp = str;
	tempArr = temp.split("");
	intArr = tempArr.length;
	if(intArr<=intShow) {
		subTemp = temp;
	}
	else {
		subTemp = temp.substr(beginShow,showLength) + "...";
	}
	document.write(subTemp);
}

function NumDot_2(txtObj){
	var strTemp = txtObj.value;
	if (validateForm_Num(txtObj)==true) {
		strTemp = fixTo(strTemp,2);
	}
	if(strTemp==0){
		strTemp = "0.00"
	}
	txtObj.value = strTemp;
}

function MyRound(number,i){
	var y=Math.pow(10,i);
	number=number * y;
	number=Math.round(number) /y;
	return number;
}

function fixTo(s,i){
	if(parseFloat(s)<0.5 && parseFloat(s)>0) {
		return MyRound(s,i);
	}
	if(parseInt(i)==2) {
		if (s==null || s=="" || isNaN(s) || Math.round(s,i)==0 || parseFloat(s)==0){
			return "0.00";
		}
	}
	if(parseInt(i)==4) {
		if (s==null || s=="" || isNaN(s) || Math.round(s,i)==0 || parseFloat(s)==0){
			return "0.0000";
		}
	}
	i = Math.round(i);
	if (i==0){
		return Math.round(s);
	}
	if (i==null || isNaN(i) || i<0){
		i=2;
	}
	if(parseFloat(s)>=1) {
		var v = Math.round(s*Math.pow(10,i)).toString();
		if(v.substr(0,v.length-i)==""){
			v.substr(0,v.length-i) = 0;
		}
		return v.substr(0,v.length-i)+"."+v.substr(v.length-i);
	}
	else{
		return s;
	}
}

function NumDot_2(strValue){
	var strTemp = strValue;
	//if (validateForm_Num(txtObj)==true) {
		strTemp = fixTo(strTemp,2);
	//}
	//if(strTemp==0){
	//	strTemp = "0.00"
	//}
	document.write(strTemp);
}

function NumDotInput_2(txtObj){
	var strTemp = txtObj.value;
	if (validateForm_Num(txtObj)==true) {
		strTemp = fixTo(strTemp,2);
	}
	if(strTemp==0){
		strTemp = "0.00"
	}
	txtObj.value = strTemp;
}
	
