// TO PRINT A SPECIFIC FRAMED PAGE (C) 2004 www.CodeLifter.com
// Free for all users, but leave in this header
function framePrint(whichFrame){
parent[whichFrame].focus();
parent[whichFrame].print();
}


// OPEN NEW MYWINDOW
var abc;
function mywindow(myurl, myname, nwidth){
abc=window.open(myurl, myname, nwidth);
abc.focus();
return false;
}

//OPEN A WINDOW FOR TELEPHONE NUMBERS
var phonewindow;
function myphonewindow(phonepage)
{
         var windowFeatures="left=300,top=300,width=490,height=215";
         phonewindow = window.open(phonepage,"phonenumbers",windowFeatures);
         phonewindow.focus();
         return false;
}


//TO OPEN A NEW WINDOW WITH AN EMAIL ADDRESS TELLAFRIEND
var tellwindow;
function mytellwindow(tellpage)
{
         var windowFeatures="left=300,top=300,width=350,height=200";
         tellwindow = window.open(tellpage,"tellafriend",windowFeatures);
         tellwindow.focus();
         return false;
}


//TO FORCE A PAGE INTO THE FRAME LAYOUT
function frameMe(cURL){
    //name of the frameset page (be sure to add path info)
    var frameset = cURL;

    //name of the frame to load document into
    var frame = "mainframe";

    page = new String(self.document.location.pathname);
	//alert(page);
    if(window.name != frame){
      var contents = frameset + "?" + page + "&" + frame;
      top.location.replace(contents);
    }
    return;
  }
  
  //TO CLOSE AN OPEN WINDOW
function window_onunload(){
 		 if (typeof(farmpicswindow) != "undefined" && farmpicswindow.closed == false)	 {
		 farmpicswindow.close();
		 }
}
  
//USED FOR PRELOADING
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}



//workaround for netscape for menu USE BY PRODUCTS MENU
var ns4class=''




function addBookmark(title,url) {
	if (window.sidebar) { 
	window.sidebar.addPanel(title, url,""); 
	} else if( document.all ) {
		window.external.AddFavorite( url, title);
			} else if( window.opera && window.print ) {
return true;
}
}

//TO LOAD INTO A SPECIFIC FRAME
  function loadDoc(){
    var query = window.location.search.split('&');
    var page = query[0].substr(1);
    var frame = query[1];

    if(page && frame){
      var contents = "top." + frame + ".location.replace('" + page + "')";
      eval(contents);
    }
    return;
  }

  
  //<SCRIPT>
  //<!-- Sliding script at bottom of the screen
  //var scrtxt="Welcome to Durattract Plastics. This website is best viewed at 1024x768 plus and using IE 6.0+, NS 6+ or FireFox 1.5+ or later with CSS, Frames and JavaScript";
  //var lentxt=scrtxt.length;
  //var width=100;
  //var pos=1-width;

  //function scroll() {
  //  pos++;  var scroller="";
  //  if (pos==lentxt) {
  //    pos=1-width;
  //  }
  //  if (pos<0) {
  //    for (var i=1; i<=Math.abs(pos); i++) {
  //      scroller=scroller+" ";}
  //    scroller=scroller+scrtxt.substring(0,width-i+1);
  //  }
  //  else {
  //    scroller=scroller+scrtxt.substring(pos,width+pos);
  //  }
  //  window.status = scroller;
  //  setTimeout("scroll()",300);  }
  //
  //</script>