//added for da2
//<Db1 Start>
function downtone(toneID,toneCode,toneName,singerName,toneLanguage,desc,price,toneValidDay,spName,updateTime,downTimes,relativeTime,toneFile,ltonecode ,etonename,esinger,uploadType,type,xmlfile,submenu,spid,urlflag,hotCode,cutflag,relativeDate,downloadDate,priceGroupId)
{

	//<Db1 End>
    var param = "toneID=" + toneID + "&toneCode=" + toneCode + "&toneName=" + toneName
	          + "&singerName=" + singerName + "&toneLanguage=" + toneLanguage +"&desc=" + desc + "&price=" + price
			  + "&toneValidDay=" + toneValidDay + "&spName=" + spName + "&updateTime=" + updateTime
			  + "&downTimes=" + downTimes+"&relativeTime="+relativeTime+"&tonePath="+toneFile+"&ltonecode="+ltonecode+"&tonename="+etonename+"&singer="+esinger+"&uploadType="+uploadType+"&spCode="+spid+"&type="+type+"&xmlfile="+xmlfile+"&submenu="+submenu+"&urlflag="+urlflag+"&hotCode="+hotCode+"&cutflag="+cutflag+"&relativeDate="+relativeDate+"&downloadDate="+downloadDate+"&priceGroupId="+priceGroupId;
  // window.open("userdowntone.screen?"+param,"","width=430,height=420,top=100,left=100");
	var url = "userdowntone.screen?"+param;
	openWindow(url,"width=440,height=420,top=100,left=100,scrollbars=1");
}

function isNumber(field){
    s = myTrim(field);
    var i;

    for (i=0; i<field.length; i++)
    {
        var c = field.charAt(i);
        if(!isDigit(c)){
            return false;
        }
    }
    return true;
}

function isWavFile(fileName)
{

    fileName = myTrim(fileName);
    var extName = fileName.substring(fileName.length-4).toUpperCase();
    if(extName != ".WAV")
    {
        return false;
    }
    else
    {
        return true;
    }
}

	//  <Db1 Start>
function delivertone21(toneID,toneCode,toneName,singerName,toneLanguage,desc,price,toneValidDay,spName,updateTime,downTimes,relativeTime,toneFile,ltonecode ,etonename,esinger,a,b,c,d,spid,hotCode,cutflag,relativeDate,downloadDate,reorderMode,priceGroupId,resourceType)
{

    var param = "toneID=" + toneID + "&toneCode=" + toneCode + "&toneName=" + toneName
	          + "&singerName=" + singerName + "&toneLanguage=" + toneLanguage +"&desc=" + desc + "&price=" + price
			  + "&toneValidDay=" + toneValidDay + "&spName=" + spName + "&updateTime=" + updateTime
			  + "&downTimes=" + downTimes+"&relativeTime="+relativeTime+"&tonePath="+toneFile+"&ltonecode="+ltonecode+"&tonename="+etonename+"&singer="+esinger+"&spCode="+spid+"&reorderMode="+reorderMode+"&hotCode="+hotCode+"&cutflag="+cutflag+"&relativeDate="+relativeDate+"&downloadDate="+downloadDate+"&priceGroupId="+priceGroupId+"&resourceType="+resourceType+"&uploadType="+a;
    //window.open("userdelivertone.screen?"+param,"","width=430,height=430,top=100,left=100");
	var url = "userdelivertone.screen?"+param;
	openWindow(url,"width=440,height=480,top=100,left=100,scrollbars=1");
}
//overloaded
function delivertone(toneID,toneCode,toneName,singerName,toneLanguage,desc,price,toneValidDay,spName,updateTime,downTimes,relativeTime,toneFile,ltonecode ,etonename,esinger,uploadtype,type,xmlfile,submenu,spid,hotCode,cutflag,relativeDate,downloadDate,reorderMode,priceGroupId,resourceType)
{

	var param = "toneID=" + toneID + "&toneCode=" + toneCode + "&toneName=" + toneName
	          + "&singerName=" + singerName + "&toneLanguage=" + toneLanguage +"&desc=" + desc + "&price=" + price
			  + "&toneValidDay=" + toneValidDay + "&spName=" + spName + "&updateTime=" + updateTime
			  + "&downTimes=" + downTimes+"&relativeTime="+relativeTime+"&tonePath="+toneFile+"&ltonecode="+ltonecode+"&tonename="+etonename+"&singer="+esinger+"&spCode="+spid+"&reorderMode="+reorderMode+"&uploadType="+uploadtype+"&type="+type+"&xmlfile="+xmlfile+"&submenu="+submenu+"&hotCode="+hotCode+"&cutflag="+cutflag+"&relativeDate="+relativeDate+"&downloadDate="+downloadDate+"&priceGroupId="+priceGroupId+"&resourceType="+resourceType;
    //  <Db1 End>
    //window.open("userdelivertone.screen?"+param,"","width=430,height=430,top=100,left=100");
	var url = "userdelivertone.screen?"+param;
	openWindow(url,"width=440,height=480,top=100,left=100,scrollbars=1");
}

//Db1 Start>
//adding price group id
function showtonedetail(toneID, toneCode,toneName,singerName,toneLanguage,desc,price,toneValidDay,spName,updateTime,downTimes,relativeTime,toneFile,ltonecode,etonename, esinger, uploadType,type,xmlfile,submenu,spid,urlflag,hotCode,cutflag,relativeDate,downloadDate,priceGroupId)
{

	var param = "toneID=" + toneID + "&toneCode=" + toneCode + "&toneName=" + toneName
	          + "&singerName=" + singerName + "&toneLanguage=" + toneLanguage +"&desc=" + desc + "&price=" + price
			  + "&toneValidDay=" + toneValidDay + "&spName=" + spName + "&updateTime=" + updateTime
			  + "&downTimes=" + downTimes+"&relativeTime="+relativeTime+"&tonePath="+toneFile+"&ltonecode="
	+ltonecode+"&tonename="+etonename+"&singer="+esinger+"&uploadType="+uploadType+"&type="+type
		+"&xmlfile="+xmlfile+"&submenu="+submenu+"&urlFlag="+urlflag+"&hotCode="+hotCode+"&cutFlag="
	+cutflag+"&relativeDate="+relativeDate+"&downloadDate="+downloadDate+"&spCode="+spid+"&priceGroupId="
	+priceGroupId;

	   // window.open("/user/tonedetails.do?"+param,"","width=430,height=430,top=100,left=100");
		var url = "/user/tonedetails.do?"+param;
	openWindow(url,"width=440,height=430,top=100,left=100,scrollbars=1");
}


<!--for corp and My RBTs
function showtonedetail1(toneID, toneCode,toneName,singerName,toneLanguage,desc,price,toneValidDay,spName,updateTime,downTimes,relativeTime,toneFile,ltonecode,etonename, esinger, uploadType,type,xmlfile,submenu,spid,urlflag,cutflag,relativeDate,downloadDate,reorderMode,priceGroupId,resourceType)
{

	var param = "toneID=" + toneID + "&toneCode=" + toneCode + "&toneName=" + toneName
	          + "&singerName=" + singerName + "&toneLanguage=" + toneLanguage +"&desc=" + desc + "&price=" + price
			  + "&toneValidDay=" + toneValidDay + "&spName=" + spName + "&updateTime=" + updateTime
			  + "&downTimes=" + downTimes+"&relativeTime="+relativeTime+"&tonePath="+toneFile+"&ltonecode="+ltonecode+"&tonename="+etonename+"&singer="+esinger+"&uploadType="+uploadType+"&type="+type+"&xmlfile="+xmlfile+"&submenu="+submenu+"&urlFlag="+urlflag+"&cutFlag="+cutflag+"&relativeDate="+relativeDate+"&downloadDate="+downloadDate+"&priceGroupId="+priceGroupId+"&reorderMode="+reorderMode+"&resourceType="+resourceType+"&spCode="+spid;

	   // window.open("/user/tonedetails.do?"+param,"","width=430,height=430,top=100,left=100");
		var url = "/user/moviename1.do?"+param;
	openWindow(url,"width=440,height=430,top=100,left=100,scrollbars=1");
}


function showtonedetail2(toneID, toneCode,toneName,singerName,toneLanguage,desc,price,toneValidDay,spName,updateTime,downTimes,relativeTime,toneFile,ltonecode,etonename, esinger, uploadType,type,xmlfile,submenu,urlflag,spid)
{


	var param = "toneID=" + toneID + "&toneCode=" + toneCode + "&toneName=" + toneName
	          + "&singerName=" + singerName + "&toneLanguage=" + toneLanguage +"&desc=" + desc + "&price=" + price
			  + "&toneValidDay=" + toneValidDay + "&spName=" + spName + "&updateTime=" + updateTime
			  + "&downTimes=" + downTimes+"&relativeTime="+relativeTime+"&tonePath="+toneFile+"&ltonecode="+ltonecode+"&tonename="+etonename+"&singer="+esinger+"&uploadType="+uploadType+"&type="+type+"&xmlfile="+xmlfile+"&submenu="+submenu+"&urlFlag="+urlflag+"&spCode="+spid;

	   // window.open("/user/tonedetails.do?"+param,"","width=430,height=430,top=100,left=100");
		var url = "/user/corpdetail.do?"+param;
	openWindow(url,"width=440,height=430,top=100,left=100,scrollbars=1");
}

//end da2
function openWindow(url,winprops)
{
    var targetName = "Create";
	var winHandler;
	winHandler=window.open('',targetName, winprops);
	winHandler.close();
	winHandler = window.open(url, targetName, winprops);

}


function isValidate(field)
{


	var i;

	for (i = 0; i < field.length; i++)
	{
		var c = field.substr(i,1);

		if (! (isLetter(c) || isDigit(c) ) )
		{
			return false;
		}
	}

	return true;
}

function isLetterString(field)
{
	field = myTrim(field);

	var i;

	for (i = 0; i < field.length; i++)
	{
		var c = field.charAt(i);

		if (! isLetter(c) )
		{
			return false;
		}
	}

	return true;
}


function isRunNian(s){
	//alert(s%4);
	if(s%4!=0){
		return false;
	}else{
		if(s%100!=0){
			return true;
		}else{
			if(s%400==0){
				return true;
			}else{
				return false;
			}
		}
	}
}



 function getLastDay(year,month){
	var s = new Array("01","03","05","07","08","10","12");
	var s1=new Array("04","06","09","11");

	for(i=0;i< s.length;i++){
		if(month==s[i]){
			return "31";
		}
	}

	for(i=0;i<s1.length;i++){
		if(month==s1[i]){
			return "30";
		}
	}

	if(isRunNian(year)){
		return "29";
	}else{
		return "28";
	}

}



function isNumbers(field)
{
	field = myTrim(field);

	var i;

	for (i = 0; i < field.length; i++)
	{
		var c = field.charAt(i);

		if (!isDigit(c) )
		{
			return false;
		}
	}

	return true;
}


function radio_active(radio_group)
{
	for(counter = 0 ; counter < radio_group.length ; counter++)
	{
		if(radio_group[counter].checked)
		{
			return counter;
		}
	}

	return -1;
}


function isEmpty(field)
{
	return ((field == null) || (field.length == 0) || myTrim(field)=="");
}


function isInteger(field)
{
	var s = myTrim(field);

	var i;

	if (isEmpty(field))
	{
		return false;
	}

	for (i=0; i<field.length; i++)
	{
		var c = field.charAt(i);

		if (!isDigit(c))
		{
			return false;
		}

		if(c==0&&i==0&&field.length>1)
		{
			return false;
		}
	}

	return true;
}


function isLetter(c)
{
	return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) );
}


function isDigit(c)
{
	return ((c >= "0") && (c <= "9"));
}

function myTrim(str)
{
	var end = false;
	var ch;

	while(!end)
	{
		if (str.length == 0) break;
		ch = str.charAt(0);

		if (ch == ' ')
		{
			str = str.substring(1,str.length);
		}
		else
		{
			end = true;
		}
	}

	end = false;

	while(!end)
	{
		if (str.length == 0)
		{
			break;
		}

		ch = str.charAt(str.length-1);

		if (ch == ' ')
		{
			str = str.substring(0,str.length-1);
		}
		else
		{
			end = true;
		}
	}

	return str;
}



function myReset(w, h)
{
	var pox = (screen.width-w)/2;
	var poy = (screen.height-h)/2;
	window.resizeTo(w+15, h+10);
	window.moveTo(((pox>0&&pox<screen.width)?pox:0), ((poy>0&&poy<screen.height)?poy:0));
}


function calculatebytesize(field)
{
	field = myTrim(field);

	var i;
	var size=0;

	for (i = 0; i < field.length; i++)
	{
		var c = field.charAt(i);

		if (((c >= "!") && (c <= "\u20AC") ) || c ==' ')
		{
			size=size+1;
		}
		else
		{
			size=size+2;
		}
	}

	return size;
}




function setLetterBorder(toneNameLetter)
{
	var imgName = "img" + toneNameLetter.toLowerCase();
	document.images[imgName].border = 2;

}




function setSelectValue(selectstart, value1, selectend, value2)
{
	if(selectstart.value == value1)
	{
		selectend.value = value2;
		selectend.disabled = true;
	}
	else
	{
		selectend.disabled = false;
	}
}



function checkHandPhone(phone , countrytype)
{

	if(isNaN(phone))
	{
		return 1;
	}


	if(countrytype == 1)
	{
		if(phone.length != 8)
		{
			return 2;
		}
		else if(phone.charAt(0) != '0')
		{
			return 3;
		}
		else
		{
			return 0;
		}
	}
	else
	{
		if(phone.length != 11)
		{
			return 2;
		}
		else if(phone.charAt(0) != '1' || phone.charAt(1) != '3')
		{
			return 3;
		}
		else
		{
			return 0;
		}
	}
}



function checkFixedPhone(phone)
{
	if(isNaN(phone))
	{
		return 1;
	}
	else if(phone.length == 0)
	{
		return 2;
	}
	else if (phone.length > 15)
	{
		return 3;
	}

	else if(phone.charAt(0) != '0')
	{
		return 4;
	}
	else if(	phone.length <10)
	{
		return 5;
	}
	else
	{
		return 0;
	}
}




function convertDBFormat(dbField)
{
	var returnStr = "";
	var fieldArray = dbField.split("'");

	for(var i = 0; i < fieldArray.length; i++)
	{
		if(i == fieldArray.length - 1)
		{
			returnStr = returnStr + fieldArray[i];
		}
		else
		{
			returnStr = returnStr + fieldArray[i] + "''";
		}
	}

	return returnStr;
}


function play(field)
{
	document.all.bgsound.src=field;
}




function round_decimals(original_number , decimals)
{
	var result1 = original_number * Math.pow(10 , decimals);
	var result2 = Math.round(result1);
	var result3 = result2 / Math.pow(10 , decimals);

	return(result3);
}



// Modified for Fixing the Defect ID: AA6D01310 By Jayesh Damodar Patel on 19-02-2007
/*function containInvalidChar(field)
{
	for (i = 0; i < field.length; i++)
	{
		var c = field.charAt(i);

		if(c == '?' || c == '&' || c == '<'
		   || c == '>' || c == '\'' || c == '"'
		   || c == '@' || c == '#'|| c == '\\'|| c == '`'
		   || c == ';' || c == '$' || c == '^' || c == '\/'|| c == '!' || c == '~' || c == '_'|| c == '%'|| c == ','|| c == '|'|| c == '+'|| c == '*')
		{
			return true;
		}
	}

	return false;
}*/

var reg = " ";
function containInvalidChar(field)
{
	var i=0, j=0;
	for (i = 0; i < field.length; i++)
	{
		var c = field.charAt(i);
		for (j = 0; j < reg.length; j++)
		{
			if(c == reg.charAt(j) )
			{
				return true;
			}
		}
	}

	return false;
}

// Modification for the Defect ID: AA6D01310 By Jayesh Damodar Patel Ends.




function converturlcode(field)
{
	field = field.replace('%','%25')
	field = field.replace('&','%26')
	field = field.replace('"','&quot;')
	field = field.replace('>','&gt;')
	field = field.replace('<','&lt;')
	field = field.replace('#','%23')
	field = field.replace('+','%2B')

	return field;
}






function dropit2(name)
{
	var zindex=100
	var sOpen=""
	var nMenuNum = name.substring(name.length - 1,name.length)

	sOpen="dropmenu" + nMenuNum

	var themenu=document.all[sOpen]

	if (themenu == null)
	{
		return
	}

	if (document.all)
	{
		themenu.style.left=document.body.scrollLeft+event.clientX-event.offsetX
		themenu.style.top=document.body.scrollTop+event.clientY-event.offsetY+25

		if (themenu.style.visibility=="hidden")
		{
			 themenu.style.visibility="visible"
			 themenu.style.zIndex=zindex++
		}
	}
}


function hidemenu(name)
{
	var zindex=100
	var sOpen=""
	var nMenuNum = name.substring(name.length - 1,name.length)
	sOpen="dropmenu" + nMenuNum
	var themenu=document.all[sOpen]

	if (themenu == null)
	{
		return;
	}

	var theID = window.event.toElement.id.substring(0,1)

	if(window.event.toElement.id!=sOpen && window.event.toElement.id!="link" )
	{
		themenu.style.visibility="hidden";
	}
}





function decomposeString(str, sperate1, sperate2)
{
	var returnArray = new Array();
	var tempArray = str.split(sperate1);
	var p = 0;

	for(i = 0; i < tempArray.length; i++)
	{
		var andArray = tempArray[i].split(sperate2);

		for(j = 0; j < andArray.length; j++)
		{
			if(andArray[j] != '' && andArray[j] != null)
			{
				returnArray[p++] = andArray[j];
			}
		}
	}

	return returnArray;
}


var new_window


function window_available()
{
	if(! new_window)
	{
		return false;
	}
	else if(new_window.closed)
	{
		return false;
	}
	else
	{
		return true;
	}
}


function play(url , toneName , backgroundmap)
{

	if(!window_available())
	{

		new_window = window.open('/auditionpage.htm' ,"", "width=200 , height=200");
		//new_window.close();
	}
	else
	{
		new_window.close();
		new_window = window.open('/auditionpage.htm' ,"", "width=0 , height=0");
	}



	new_window.MediaPlayer.FileName = url;
	//new_window.MediaPlayer.Play();

}



function validatetime(dateString)
{

	if(dateString.length!=8)
	{
		return false;
	}

	if(isNumbers(dateString.substring(0,2))==false
	   ||isNumbers(dateString.substring(3,5))==false
	   ||isNumbers(dateString.substring(6,8))==false)
	{
		return false;
	}

	if(dateString.charAt(2)!=':'||dateString.charAt(5)!=':')
	{
		return false;
	}

	var hour=parseInt(dateString.substring(0,2),10);
	var minute=parseInt(dateString.substring(3,5),10);
	var second=parseInt(dateString.substring(6,8),10);

	if(hour<24&&minute<60&&second<60)
	{
		return true;
	}
	else
	{
		return false;
	}

}


 var listenWindow;
function listen(toneboxid,toneboxcode,toneboxname,feetype,price,toneBoxDescription,spname,downloadtime,flag,relativeDay,day,tonefile,etoneboxname,urlFlag)
{
	var param = "toneBoxID=" + toneboxid + "&toneBoxCode=" + toneboxcode + "&toneBoxName=" + toneboxname
	          + "&feeType=" + feetype + "&price=" + price + "&spName=" + spname
			  + "&toneBoxDescription=" + toneBoxDescription + "&downloadTime=" + downloadtime + "&flag=" + flag  + "&relativeTime="+ relativeDay + "&day=" + day+"&tonePath="+tonefile+"&toneCode="+etoneboxname+"&urlFlag="+urlFlag;
   var url = "/user/listentone.screen?"+param;
	openWindow(url,"width=450,height=500,top=100,left=100,scrollbars=1");
   //window.open("/user/listentone.screen?"+param,"","width=450,height=500,top=100,left=100,scrollbars=1");
}
var downloadWindow;
function showDatal(toneID,toneCode,toneName,singerName,toneLanguage,desc,price,toneValidDay,spName,updateTime,downTimes,relativeTime)
{
	 if(downloadWindow!=null)
	 {
		  downloadWindow.close();
      }
	var param = "toneID=" + toneID + "&toneCode=" + toneCode + "&toneName=" + toneName
	          + "&singerName=" + singerName + "&toneLanguage=" + toneLanguage +"&desc=" + desc + "&price=" + price
			  + "&toneValidDay=" + toneValidDay + "&spName=" + spName + "&updateTime=" + updateTime
			  + "&downTimes=" + downTimes + "&relativeTime="+relativeTime;
    window.open("userdowntone.screen?"+param,"","width=400,height=400,top=100,left=100");
}


 var adminlistenWin
function adminlisten(toneType,tongPath, toneID, toneName)
{
	if(adminlistenWin != null)
	{
		 adminlistenWin.close();
	}
	var left = 20;//Math.floor( (screen.width - 400) / 2);
	var top = 20;//Math.floor( (screen.height - 300) / 2);
	adminlistenWin = window.open("../admin/listentone.screen?toneType="+toneType+"&tonePath="+tongPath+"&toneID="+toneID+"&toneName="+toneName,"","width=400,height=300,top="+top+",left="+left);
}


 var splistenWin;
function splisten(toneType,tongPath, toneID, toneName)
{
	if(splistenWin != null)
	{
		 splistenWin.close();
	}
	var left = 20;//Math.floor( (screen.width - 400) / 2);
	var top = 20;//Math.floor( (screen.height - 300) / 2);
	splistenWin = window.open("../sp/listentone.screen?toneType="+toneType+"&tonePath="+tongPath+"&toneID="+toneID+"&toneName="+toneName,"","width=400,height=300,top="+top+",left="+left);
}

 var corplistenWin;
function corplisten(toneType,tongPath, toneID, toneName)
{
	if(corplistenWin != null)
	{
		 corplistenWin.close();
	}
	var left = 20;//Math.floor( (screen.width - 400) / 2);
	var top = 20;//Math.floor( (screen.height - 300) / 2);
	corplistenWin = window.open("../corp/listentone.screen?toneType="+toneType+"&tonePath="+tongPath+"&toneID="+toneID+"&toneName="+toneName,"","width=400,height=300,top="+top+",left="+left);
}
function numberOnly() // onkeypress event
{
  var key = window.event.keyCode;
  if(( key > 47 && key < 58 ) || (key==8)|| (key==9)|| (key==13)|| (key==37)|| (key==38)
	|| (key==39)|| (key==40)|| (key==46) || ( key > 95 && key < 106 ))
	  window.event.returnValue = true;
  else {
	  window.event.returnValue = false;
	  alert("");
  }
}

function trim(strValue)
{
	var iLTR, jRTL;
	var chr;


	for( iLTR = 0; iLTR < strValue.length; iLTR++ )
	{
		chr = strValue.charAt(iLTR) ;
		if( chr != " " ) break;
	}

	if( iLTR == strValue.length ) return "";


	for( jRTL = strValue.length - 1; jRTL >= 0; jRTL-- )
	{
		chr = strValue.charAt(jRTL);
		if( chr != " " ) break;
	}
	return strValue.substring(iLTR, jRTL + 1);
}

function trimZero(strValue)
{
	var iLTR;
	var chr;


	for( iLTR = 0; iLTR < strValue.length; iLTR++ )
	{
		chr = strValue.charAt(iLTR) ;
		if( chr != "0" ) break;
	}

	if( iLTR == strValue.length ) return "";

	return strValue.substring(iLTR, strValue.length);
}


function existChinese(strValue)
{
	var chrCode
	for(var iChar = 0; iChar < strValue.length; iChar++)
	{
		chrCode = strValue.charCodeAt(iChar);
		if(parseInt(chrCode) > 255)
		{
			return true;
		}
	}
	return false;
}

var listendiyWindow;
function listendiy(tName,tFile,tCode,tInfo,tDay,price,requestFlag,relativeTime,relativeDate,downloadDate)
{
	if(listendiyWindow != null)
	{
		 listendiyWindow.close();
	}
	var left = 20;//Math.floor( (screen.width - 400) / 2);
	var top = 20;//Math.floor( (screen.height - 300) / 2);


    listendiyWindow = window.open("../user/listendiy.screen?tName="+tName+"&tFile="+tFile+"&tCode="+tCode+"&tInfo="+tInfo+"&tDay="+tDay+"&price="+price+"&requestFlag="+requestFlag+"&relativeTime="+relativeTime+"&relativeDate="+relativeDate+"&downloadDate="+downloadDate,"","width=420,height=390,scrollbars=1,top="+top+",left="+left);
}
//  <Db1 Start>
function showNormTonedetail(toneID,toneCode,toneName,singerName,toneLanguage,desc,price,toneValidDay,spName,updateTime,downTimes,relativeTime,toneFile,ltonecode,etonename,esinger,uploadType,type,xmlfile,submenu,spid,urlflag,reorderMode,isMusicDisc,priceGroupId)
{
	
	var param = "toneID=" + toneID + "&toneCode=" + toneCode + "&toneName=" + toneName
	          + "&singerName=" + singerName + "&toneLanguage=" + toneLanguage +"&desc=" + desc + "&price=" + price
			  + "&toneValidDay=" + toneValidDay + "&spName=" + spName + "&updateTime=" + updateTime
			  + "&downTimes=" + downTimes+"&relativeTime="+relativeTime+"&tonePath="+toneFile+"&ltonecode="+ltonecode+"&tonename="+etonename+"&singer="+esinger+"&uploadType="+uploadType+"&type="+type+"&xmlfile="+xmlfile+"&submenu="+submenu+"&urlFlag="+urlflag+"&reorderMode="+reorderMode+"&isMusicDisc="+isMusicDisc+"&priceGroupId="+priceGroupId+"&spCode="+spid;
//  <Db1 End>
	   // window.open("/user/tonedetails.do?"+param,"","width=430,height=430,top=100,left=100");
		var url = "/user/qrytonecopymovidetail.do?"+param;
	openWindow(url,"width=440,height=380,top=100,left=100,scrollbars=1");
}


function formatInputNumber(oElement, length, decimal)
{
	var oInput = oElement;
	var oInputValue = trim(oInput.value);
	var iLowcase = oInputValue.indexOf("e");
	var iUpcase = oInputValue.indexOf("E");

	if( oInputValue == "")
	{
		oInput.value = "";
		return true;
	}

	if (existChinese(oInputValue))
	{
		oInput.value = "";
		return true;
	}

	if((iLowcase != -1)||(iUpcase != -1))
	{
		return true;
	}


	var bOverflow = false;
	var partInteger = "";
	var countIntegerLength = 0;
	var partDecimal = "";
	var countDecimalLength = 0;

	var iPoint = oInputValue.indexOf(".");

	var allowIntegerLength = length - decimal - 1;
	var allowDecimalLength = decimal;


	if(iPoint == -1)
	{
		partInteger = oInputValue;
		partInteger = trimZero(partInteger);
		countIntegerLength = oInputValue.length;
	}
	else
	{
		partInteger = oInputValue.substring(0,iPoint);
		partInteger = trimZero(partInteger);
		countIntegerLength = partInteger.length;

		partDecimal = oInputValue.substring(iPoint + 1, iPoint + 1 + allowDecimalLength);
		countDecimalLength = partDecimal.length;
	}
	if (partInteger == "")
	{
		partInteger = "0";
	}


	if(countIntegerLength > allowIntegerLength)
	{
		partInteger = "0";
		bOverflow = true;
	}


	if(countDecimalLength < allowDecimalLength)
	{
		for (var iDecimal = 0; iDecimal < (allowDecimalLength - countDecimalLength); iDecimal++)
			partDecimal = partDecimal + "0";
	}


	if (partDecimal != "")
	{
		oInput.value = partInteger + "." + partDecimal;
	}
	else
	{
		oInput.value = partInteger
	}
	if (bOverflow) oInput.focus();
}


function clearValue(obj){
	obj.value = "";
}
//Added for defect AA6D03679. Begin
var calendarFlag = false;
var found =false;
var elementid = ["RBTstatusList","SPList","MainList","ChildList","calendarlayer"];
var layerFlag = false;
document.onmousedown = function(event)
{
	var targ;
	var e = window.event;
	if(!e)
		e=event;

	var i=0;
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;

	if (targ.nodeType == 3) // defeat Safari bug
	targ = targ.parentNode; // Get the tag on which mouse action occured
	var tname;
	tname=targ.tagName;

	var src;

	if (tname=='IMG') {
		   src =targ.src;
		   if(src.indexOf("selectdate.gif")>0)
			   found=true;
	}



	if (found)
	{
		document.all.calendarlayer.onmousedown = function() {
		calendarFlag = true;
		}
	}

	if(!targ.className || ( targ.className && targ.className != 'tr03')) {
	    for(i=0; i<elementid.length;i++){
		var layer = document.getElementById(elementid[i].toString());
		if(elementid[i].toString()!= 'calendarlayer' && !layerFlag && layer && layer.style)
				layer.style.display = "none";

		}

	}

 if(!calendarFlag && document.all.calendarlayer )
		document.all.calendarlayer.style.visibility = "hidden";


 calendarFlag = false;
 layerFlag = false;

}

function isAlphaNumeric(field)
{
	field = myTrim(field);

	var i;

	for (i = 0; i < field.length; i++)
	{
		var c = field.charAt(i);

		if (!isLetter(c) && !isDigit(c) )
		{
			return false;
		}
	}

	return true;
}

function dynCatPopUp(dynCat)
{
	openWindow("/user/dyncatdisplay.screen?cat="+dynCat,"width=680,height=480,top=100,left=100,scrollbars=1");
}

function homePagePopUp(url)
{
	openWindow(url,"width=630,height=450,top=10,left=10,scrollbars=1");
}

function locationWindow(url,width,height)
{
	window.location = url;
	window.resizeTo(width,height);
}

function downtoneSameWindow(toneID,toneCode,toneName,singerName,toneLanguage,desc,price,toneValidDay,spName,updateTime,downTimes,relativeTime,toneFile,ltonecode ,etonename,esinger,reorderMode,type,xmlfile,submenu,spid,urlflag,hotCode,cutflag,relativeDate,downloadDate,priceGroupId)
{	
	
    var param = "toneID=" + toneID + "&toneCode=" + toneCode + "&toneName=" + toneName
	          + "&singerName=" + singerName + "&toneLanguage=" + toneLanguage +"&desc=" + desc + "&price=" + price
			  + "&toneValidDay=" + toneValidDay + "&spName=" + spName + "&updateTime=" + updateTime
			  + "&downTimes=" + downTimes+"&relativeTime="+relativeTime+"&tonePath="+toneFile+"&ltonecode="+ltonecode+"&tonename="+etonename+"&singer="+esinger+"&spCode="+spid+"&reorderMode="+reorderMode+"&type="+type+"&xmlfile="+xmlfile+"&submenu="+submenu+"&urlFlag="+urlflag+"&hotCode="+hotCode+"&cutFlag="+cutflag+"&relativeDate="+relativeDate+"&downloadDate="+downloadDate+"&priceGroupId="+priceGroupId+"&uploadType="+reorderMode;
	var url = "userdowntone.screen?"+param;
	locationWindow(url,440,420);
}

function showtonedetailSameWindow(toneID, toneCode,toneName,singerName,toneLanguage,desc,price,toneValidDay,spName,updateTime,downTimes,relativeTime,toneFile,ltonecode,etonename, esinger, uploadType,type,xmlfile,submenu,spid,urlflag,hotCode,cutflag,relativeDate,downloadDate,priceGroupId)
{

	var param = "toneID=" + toneID + "&toneCode=" + toneCode + "&toneName=" + toneName
	          + "&singerName=" + singerName + "&toneLanguage=" + toneLanguage +"&desc=" + desc + "&price=" + price
			  + "&toneValidDay=" + toneValidDay + "&spName=" + spName + "&updateTime=" + updateTime
			  + "&downTimes=" + downTimes+"&relativeTime="+relativeTime+"&tonePath="+toneFile+"&ltonecode="+ltonecode+"&tonename="+etonename+"&singer="+esinger+"&uploadType="+uploadType+"&type="+type+"&xmlfile="+xmlfile+"&submenu="+submenu+"&urlFlag="+urlflag+"&hotCode="+hotCode+"&cutFlag="+cutflag+"&relativeDate="+relativeDate+"&downloadDate="+downloadDate+"&spCode="+spid+"&priceGroupId="+priceGroupId;
	var url = "/user/tonedetails.do?"+param;
	locationWindow(url,440,480);
}


function delivertoneSameWindow(toneID,toneCode,toneName,singerName,toneLanguage,desc,price,toneValidDay,spName,updateTime,downTimes,relativeTime,toneFile,ltonecode ,etonename,esinger,uploadType,type,xmlfile,submenu,spid,urlflag,hotCode,cutflag,relativeDate,downloadDate,priceGroupId)
{

    var param = "toneID=" + toneID + "&toneCode=" + toneCode + "&toneName=" + toneName


	          + "&singerName=" + singerName + "&toneLanguage=" + toneLanguage +"&desc=" + desc + "&price=" + price
			  + "&toneValidDay=" + toneValidDay + "&spName=" + spName + "&updateTime=" + updateTime
			  + "&downTimes=" + downTimes+"&relativeTime="+relativeTime+"&tonePath="+toneFile+"&ltonecode="+ltonecode+"&tonename="+etonename+"&singer="+esinger+"&spCode="+spid+"&uploadType="+uploadType+"&type="+type+"&xmlfile="+xmlfile+"&submenu="+submenu+"&urlFlag="+urlflag+"&hotCode="+hotCode+"&cutFlag="+cutflag+"&relativeDate="+relativeDate+"&downloadDate="+downloadDate+"&priceGroupId="+priceGroupId;
	var url = "userdelivertone.screen?"+param;
	locationWindow(url,440,480);
}
//End

//<Db1 Start>

function viewTariffDetailsForUser(tariffID, brandID, defaultPrice, location)
{

    var url = "/user/viewtariffdetails.screen?tariffID=" + tariffID + "&brandID=" + brandID + "&defaultPrice=" + defaultPrice + "&location=" + location;

 openWindow(url,"width=450,height=500,top=100,left=100,scrollbars=1");
}


function viewTariffDetailsSameWindow(tariffID, brandID, defaultPrice, location, WindowLocation,page,pageFrom,listID,fromDynCat,rettoneID,rettoneCode,rettoneName,retsingerName,rettoneLanguage,retdesc,retprice,rettoneValidDay,retspName,retupdateTime,retdownTimes,retrelativeTime,rettonePath,retltonecode,rettonename,retsinger,retuploadType,rettype,retxmlfile,retsubmenu,returlFlag,rethotCode,retcutFlag,retrelativeDate,retdownloadDate,retspCode,retpriceGroupId,retreorderMode,retresourceType,retisMusicDisc)
{
	
 var url = "/user/viewtariffdetails.screen?tariffID=" + tariffID + "&brandID=" + brandID + "&defaultPrice=" + defaultPrice + "&location=" + location+"&WindowLocation="+WindowLocation+"&Page="+page+"&pageFrom="+pageFrom+"&listID="+listID+"&fromDynCat="+fromDynCat+"&rettoneID="+rettoneID+"&rettoneCode="+rettoneCode+"&rettoneName="+rettoneName+"&retsingerName="+retsingerName+"&rettoneLanguage="+rettoneLanguage+"&retdesc="+retdesc+"&retprice="+retprice+"&rettoneValidDay="+rettoneValidDay+"&retspName="+retspName+"&retupdateTime="+retupdateTime+"&retdownTimes="+retdownTimes+"&retrelativeTime="+retrelativeTime+"&rettonePath="+rettonePath+"&retltonecode="+retltonecode+"&rettonename="+rettonename+"&retsinger="+retsinger+"&retuploadType="+retuploadType+"&rettype="+rettype+"&retxmlfile="+retxmlfile+"&retsubmenu="+retsubmenu+"&returlFlag="+returlFlag+"&rethotCode="+rethotCode+"&retcutFlag="+retcutFlag+"&retrelativeDate="+retrelativeDate+"&retdownloadDate="+retdownloadDate+"&retspCode="+retspCode+"&retpriceGroupId="+retpriceGroupId+"&retreorderMode="+retreorderMode+"&retresourceType="+retresourceType+"&retisMusicDisc="+retisMusicDisc;

locationWindow(url,460,500,100,100,1);
}
