function showLoader(show){
 if(show){ 
	 ds = 'block'; 
	if (BrowserDetect.browser == "Explorer" && BrowserDetect.version <= 6) {
		my_win_width = 400;
		my_win_height = 300;
		my_left = (document.documentElement.clientWidth / 2) - (my_win_width / 2);
		new_my_left = round_decimals(my_left,0)
		
		my_top = (document.documentElement.clientHeight / 2) - (my_win_height / 2);
		new_my_top = round_decimals(my_top,0)
		my_scroll_top = round_decimals(document.documentElement.scrollTop,0)
		new_my_top2 = (new_my_top*1) + (my_scroll_top*1);
		document.getElementById('loader').style.position = "absolute";
		document.getElementById('loader').style.left = new_my_left;
		document.getElementById('loader').style.marginLeft = 0;
		document.getElementById('loader').style.top = new_my_top2;
		document.getElementById('loader').style.marginTop = 0;
	}
 }
 else{ 
	 ds = 'none'; 
 }
 document.getElementById('loader_bg').style.display = ds;
 document.getElementById('loader').style.display = ds;
  if(!show) {
	frames['loader_frame'].location.href = "/blank.html";
 }
 }

function imageBox() {
	loader_frame.location="/shared/upload_image.cfm?image_type=forum";
	showLoader(1);
}
function checkAllF(field) { 
	for (i = 0; i < field.length; i++) {
		field[i].checked = true ; 
	}
}

function uncheckAllF(field) { 
	for (i = 0; i < field.length; i++) {
		field[i].checked = false ; 
	}
}

function CheckCookie (CookieName) {
	  var lf = "\\n";
    var CookieString = document.cookie;
    var CookieSet = CookieString.split (';');
    var SetSize = CookieSet.length;
    var CookiePieces
    var ReturnValue = "";
    var x = 0;
    for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++) {
      CookiePieces = CookieSet[x].split ('=');
      if (CookiePieces[0].substring (0,1) == ' ') {
        CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
      }
      if (CookiePieces[0] == CookieName) {
        ReturnValue = CookiePieces[1];
      }
     }
     return ReturnValue;
 }

 function setReferrer() {
	document.cookie="referrer="+document.referrer+"; expires=Tuesday, 01-Apr-2010 08:00:00 GMT; path=/; domain=.yarnmarket.com";
}

my_ref = CheckCookie('referrer');
if (my_ref.length > 3) {
	setReferrer();
}

function big_photo(which_photo,width,height) {	
	var URL = 'big_photo.cfm?image_link=' + which_photo + '&width=' + width + '&height=' + height;

    var windowName = 'yt_photo'

    var features =
        'width='        + width +
        ',height='      + height +
        ',location=no' +
        ',menubar=no' +
        ',scrollbars=auto' +
        ',status=no' +
        ',toolbar=no' +
        ',resizable=no,top=10,left=10';

    window.open (URL, windowName, features);
}
function popUp(URL,windowName,width,height) {	
    var features =
        'width='        + width +
        ',height='      + height +
        ',location=no' +
        ',menubar=no' +
        ',scrollbars=yes' +
        ',status=no' +
        ',toolbar=no' +
        ',resizable=yes,top=10,left=10';

    window.open (URL, windowName, features);
}


var myimages=new Array()
function preloadimages(){
	for (i=0;i<preloadimages.arguments.length;i++){
		myimages[i]=new Image()
		myimages[i].src=preloadimages.arguments[i]
	}
}

preloadimages("art/buy.gif","art/see.gif","art/pix.gif");


