var wname="Viewbargain";


function bookmark(url, description){
      netscape="Hit CTRL+D to add a bookmark to this site."
      if (navigator.appName=='Microsoft Internet Explorer') {
        window.external.AddFavorite(url, description);
      }
      else if (navigator.appName=='Netscape')	{
        alert(netscape);
      }
}


function trim(strText) { 
	  while (strText.substring(0,1) == ' ') 
		strText = strText.substring(1, strText.length);

	  while (strText.substring(strText.length-1,strText.length) == ' ')
		strText = strText.substring(0, strText.length-1);
	  return strText;
}




function openWindow(url) {
   openWindow(url, wname);
}

function openWindow(url, winame) {	
	  var width = parseInt(screen.availWidth*0.9) ;
	  var height = parseInt(screen.availHeight*0.6);
	  var left = parseInt(screen.availWidth*0.05);
	  var top = parseInt(screen.availHeight*0.15);
	  var windowFeatures = "width=" + width + ",height=" + height + ",resizable=1,location=1,toolbar=1,status=1,scrollbars=1,menubar=1,left=" + left   + ",top=" + top + ",screenX=" + left + ",screenY=" + top;
	  var newwindow = window.open(url, winame, windowFeatures);
	  if (window.focus) {newwindow.focus()}
}


function setHeight(topHeight) {
	try {
		var iframeElement = parent.document.getElementById('ifr_content'); 
		iframeElement.style.height = document.body.clientHeight-topHeight+"px" ;
	}
	catch(e) {
		window.status =	'Error: ' + e.number + '; ' + e.description;
	}
}


	
function delayer(new_url, go){
	setTimeout("changeurl('" + new_url + "')", 3000) ;  
}   


function changeurl(new_url){  
	document.getElementById("ifr_content").src = new_url;
} 



function get_month_name(mon){
	switch (mon)
	{
	case "01":
	  return "Jan"
	  break
	case "02":
	  return "Feb"
	  break
	case "03":
	  return "Mar"
	  break
	case "04":
	  return "Apr"
	  break
	case "05":
	  return "May"
	  break
	case "06":
	  return "Jun"
	  break
	case "07":
	  return "Jul"
	  break
	case "08":
	  return "Aug"
	  break
	case "09":
	  return "Sep"
	  break
	case "10":
	  return "Oct"
	  break
	case "11":
	  return "Nov"
	  break
	case "12":
	  return "Dec"
	  break
	}
}


function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    return true;
}



function todayStr(adding) {
    var today=new Date();
	var str_month =today.getMonth()+1;
	var str_date = today.getDate() + adding;
	var str_year = today.getFullYear();

	if (str_date>28) {
	  str_date = str_date -28;
	  str_month = str_month +1;
	}
	
	if(str_date<10){
		str_date = "0" + str_date;
	}
	if(str_month<10){
		str_month = "0" + str_month;
	}
	return str_today = str_month + "/"+ str_date  + "/"+ str_year;
}

