/*Version=<<TS_VERSION>>*/
if (!gNewWindow) {
	var gNewWindow = null;
}


function openWin(url, n, w, h, st, fullCheck){
	var width = parseInt(w);
	var height = parseInt(h);
	var postop = 0;
	var posleft = 0;
	var fullCheckNo = fullCheck;
	var toolbar;
	var location;
	var directories;
	var status;
	var menubar;
	var resizable;
	var scrollbars;
	var dependent;

	st.charAt(0) == '1'	?  toolbar = 'yes' : toolbar = 'no';
	st.charAt(1) == '1'	?  location = 'yes' : location = 'no';
	st.charAt(2) == '1'	?  directories = 'yes' : directories = 'no';
	st.charAt(3) == '1'	?  status = 'yes' : status = 'no';
	st.charAt(4) == '1'	?  menubar = 'yes' : menubar = 'no';
	st.charAt(5) == '1'	?  resizable = 'yes' : resizable = 'no';
	st.charAt(6) == '1'	?  scrollbars = 'yes' : scrollbars = 'no';
	st.charAt(7) == '1'	?  dependent = 'yes' : dependent = 'no';


	if (fullCheckNo==1){

		if (gPlatform != "Mac" && gBrowser == "MSIE" && gVersion >= 4) {

			var w = window.open(url,'','fullscreen=1');

		} else {

			if (gPlatform != "Mac"){

				// NN5 over
				if (gBrowser == "NN" && gVersion >= 5) {
					width += 1;
					height += 1;

				// NN4(for Win)
				} else if (gBrowser == "NN" && gVersion >= 4) {
					width -= 0;
					height += 20;

				// other
				} else {
					width += 0;
					height += 0;
				}

			} else {

				// NN5 over
				if (gBrowser == "NN" && gVersion >= 5) {
					width += 1;
					height -= 100;

				// NN4 for Mac
				} else if (gBrowser == "NN" && gVersion >= 4) {
					width -= 0;
					height -= 50

				// IE5 for Mac
				} else if (gBrowser == "MSIE" && gVersion >= 5) {
					width += 10;
					height += 500;

				// IE4 for Mac
				} else if (gBrowser == "MSIE" && gVersion >= 4) {
					width -= 0;
					height += 2;

				// safari for Mac
				} else if (gPlatform == "Mac" && gBrowser == "Safari" && gVersion >= 0) {
					width += -2;
					height += 50;

				// other
				} else {
					width -= 10;
					height -= 130;
				}

			}

			var win_size = 'width=' + width + ',height=' + height;
			var win_attr = 'toolbar=' + toolbar + ',location=' + location + ',directories=' + directories + ',status=' + status + ',menubar=' + menubar + ',resizable=' + resizable + ',scrollbars=' + scrollbars + ',dependent=' + dependent;
			var win_pos = 'left=' + posleft + ',top=' + postop;

			var w = window.open(url, n, win_attr + ',' + win_size + ',' + win_pos);

		}

	} else if (fullCheckNo==0){

		if (scrollbars == 'no') {

			// NN5 over
			if (gBrowser == "NN" && gVersion >= 5) {
				width += 1;
				height += 1;

			// NN4 for Mac
			} else if (gPlatform == "Mac" && gBrowser == "NN" && gVersion >= 4) {
				width -= 0;
				height -= 0;

			// NN4(for Win)
			} else if (gBrowser == "NN" && gVersion >= 4) {
				width -= 0;
				height -= 0;

			// IE5 for Mac
			} else if (gPlatform == "Mac" && gBrowser == "MSIE" && gVersion >= 5) {
				width += 55;
				height += 95;

			// IE4 for Mac
			} else if (gPlatform == "Mac" && gBrowser == "MSIE" && gVersion >= 4) {
				width -= 0;
				height += 2;

			// IE5(for Win)
			} else if (gBrowser == "MSIE" && gVersion >= 5) {
				width += 0;
				height += 0;

			// IE4(for Win)
			} else if (gBrowser == "MSIE" && gVersion >= 4) {
				width += 0;
				height += 0;

			// other
			} else {
				width += 0;
				height += 0;
			}

		}

		if (status == 'no') {

			// NN4
			if (gBrowser == "NN" && gVersion >= 4 && gVersion < 5) {
				width -= 0;
				height -= 0;

			// NN5 over
			}else if (gPlatform == "Mac" && gBrowser == "NN") {
				width += 0;
				height += 80;

			// NN5 over
			}else if (gPlatform == "Win" && gBrowser == "NN") {
				width += 0;
				height += 20;

			// safari for Mac
			} else if (gPlatform == "Mac" && gBrowser == "Safari" && gVersion >= 0) {
				width += 0;
				height += 20;
			}

		}

		var win_size = 'width=' + width + ',height=' + height;
		var win_attr = 'toolbar=' + toolbar + ',location=' + location + ',directories=' + directories + ',status=' + status + ',menubar=' + menubar + ',resizable=' + resizable + ',scrollbars=' + scrollbars + ',dependent=' + dependent;
		var win_pos = 'left=' + posleft + ',top=' + postop;

		var w = window.open(url, n, win_attr + ',' + win_size + ',' + win_pos);
		w.focus();
	}
	return false;
}


function OpenUp(sURL,winw,winh) {
	openWin(sURL, 'tmswin', winw, winh, '00000110','0');
}

function fullOpenUp(gURL) {
	hoehe = screen.height;
	breite = screen.width;
	openWin(gURL, 'tmFullMovie', breite, hoehe, '00000100','1');
}

function OpenSUp(sURL) {
	openWin(sURL, 'tmMovie', '920', '640', '00000110','0');
}




