﻿function selectPromotionImg(imgNum) {

      proImg = new Array(
         "<a href='../downloads/DownloadFileManager.aspx'><img src='../images/promotion/image01.gif' border=0></a>",
         "<a href='../WWWShare/default.aspx'><img src='../images/promotion/image02.gif' border=0></a>",
		 "<img src='../images/promotion/image03.gif' border=0>","<a href='/default.aspx'><img src='/images/P_D_3.gif' border=0></a>","<a href='/downloads/DownloadFileManager.aspx'><img src='/images/Soft_FileManger.gif' border=0></a>");
		 
      imgCount = proImg.length;
		
		if (imgNum < 0) {
			randomNum = Math.floor((Math.random() * imgCount));
			document.write(proImg[randomNum]);
		} else {
			document.write(proImg[imgNum]);
		}
}

function selectLargeProImg(imgNum) {

      proImg = new Array(
         "",
		 "");
		 
      imgCount = proImg.length;
		
		if (imgNum < 0) {
			randomNum = Math.floor((Math.random() * imgCount));
			document.write(proImg[randomNum]);
		} else {
			document.write(proImg[imgNum]);
		}
}

function selectStorageImg(imgNum) {

      proImg = new Array(
         "<a href='/help/features/PricingPlans.aspx' target=_top><img src='../images/Promotion/P_D_1.gif' border=0></a>",
		 "<a href='/help/features/PricingPlans.aspx' target=_top><img src='../images/Promotion/P_D_2.gif' border=0></a>");
		 
      imgCount = proImg.length;
		
		if (imgNum < 0) {
			randomNum = Math.floor((Math.random() * imgCount));
			document.write(proImg[randomNum]);
		} else {
			document.write(proImg[imgNum]);
		}
}

function getUrlParam(url, param)
{
	var re = new RegExp("(\\\?|&)" + param + "=([^&]+)(&|$)", "i");
	var m = url.match(re);
	if (m)
		return m[2];
	else
		return '';
}

function copyToClipBoard(content)
{
    try
    {
	    window.clipboardData.setData("Text",content);
	    alert("Copy this link successfully!");
	}
	catch(Error)
	{
	    //alert(Error);
	}
}

String.prototype.Trim = function() 
{ 
	return this.replace(/(^\s*)|(\s*$)/g, ""); 
} 

String.prototype.LTrim = function() 
{ 
	return this.replace(/(^\s*)/g, ""); 
} 

String.prototype.RTrim = function() 
{ 
	return this.replace(/(\s*$)/g, ""); 
}


