
var gotKeyword = QueryString_Parse();


function QueryString_Parse(){ 
	var query = window.location.search.substring(1); 
	var pairs = query.split("&"); 
	for (var i=0;i<pairs.length;i++){ 
		var pos = pairs[i].indexOf('='); 
		if (pos >= 0){ 
            var argname = pairs[i].substring(0,pos); 
            var value = pairs[i].substring(pos+1); 
            
            if ( argname == "search" ) {					
                    value = value.replace(/(<script[^>]*>)|(<\/script>)/g,'') ;
                    value = value.replace('%20',' '); 
                    
					return value;
            }                     
		} 
	}
	return ""; 
} 

function processKeyEvent()
{	 
	 if (window.event.keyCode == 13)  {				
	    var doc = document.forms[0]; 
		
		sKeyword = doc.search.value;
				
		sCat = doc.news.value;
		/*sUrl = "TWNKeySearchResult.aspx?SearchCat=" + sCat + "&Keyword=" +  sKeyword ;		*/
		sUrl = "http://www.finditt.com/search/extremesearch.php?search=" + sCat ;
		/* sUrl = "SearchResult.aspx?news=" + sCat + "&search=" + sKeyword ; */
		document.location.href = sUrl;
		return false; 
	 }
	 else
		return true;
}

function fSubmitSearch() 
{

    var doc = document.forms[0]; 
	sKeyword = doc.txtSearch.value;
		
	sCat = doc.news.value;
	sUrl = "http://www.finditt.com/search/extremesearch.php?search=" + sKeyword ;
	/* Url = "SearchResult.aspx?news=" + sCat + "&search=" + sKeyword ; */
	document.location.href = sUrl;
	return false; 
}


function fSubmitSearch1() 
{

    var doc = document.forms[0]; 
	sKeyword = doc.txtSearch1.value;
		
	sCat = doc.news.value;
	sUrl = "http://www.finditt.com/search/extremesearch.php?search=" + sKeyword ;
	/*sUrl = "SearchResult.aspx?news=" + sCat + "&search=" + sKeyword ; */
	document.location.href = sUrl;
	return false; 
}


function fOpenSupplierList(sUrl)
{
	window.open(sUrl,"", "height=400,width=990,left=10,top=10,status=no,toolbar=no,scrollbars=yes,location=no,resizable=yes");
}
function fViewCompanyInfo()
{
	var sUrl = "TWNKeySupplierList.aspx?Kind=1"
	window.open(sUrl,"", "height=350,width=900,left=10,top=10,status=no,toolbar=no,scrollbars=yes,location=no,resizable=yes");
}

function GetClientUTC()
{    
	var now = new Date()
	var offset = now.getTimezoneOffset();
	if (document._ctl0.elements['txtOffset'] == null) 	{
	}
	else	{
		document._ctl0.txtOffset.value = offset;
	}
}

function updateChar(agNum)
{
	if (document.forms(0).Content.value.length > agNum) {
		alert(agNum + "is limit.");
		document.forms(0).Content.value = document.forms(0).Content.value.substring(0, agNum);
	}
	limitct.innerText = document.forms(0).Content.value.length;
}

function fViewProfile(id,type) 
{ 
	var sUrl = "ProfileUploadView.aspx?id=" + id + "&type="+type;
	var xWin = window.open(sUrl,"", "height=680,width=650,left=0,top=0,status=yes,toolbar=no,scrollbars=yes,location=no,resizable=yes");
} 		
	
function fViewWeb(sUrl) 
{ 
		window.open(sUrl,"", "height=650,width=850,left=0,top=0,status=yes,toolbar=yes,scrollbars=yes,location=no,resizable=yes");
}		
function fViewCompanyInfo(sUrl) 
{ 
		window.open(sUrl,"", "height=330,width=800,left=0,top=0,status=yes,toolbar=yes,scrollbars=yes,location=no,resizable=yes");
}				
function fViewTWNKeysInfo() 
{ 
		var sUrl = "TWNKeyInfoView.aspx"
		window.open(sUrl,"", "height=650,width=850,left=0,top=0,status=yes,toolbar=yes,scrollbars=yes,location=no,resizable=yes");
}				





